If it's a textual date (ie: you have a string "2004-05-23" that you want to add 10 days to), then it's easiest to parse the textual date into a timestamp with strtotime(), then add ten days.
You can just use time() (or mktime() if you want a predefined date) to just get a timestamp isntead of parsing a textual date:
PHP Code:
$newdate = time(); // right now
$newdate = $newdate + (60 * 60 * 24 * 10);
echo date('y-m-d', $newdate);
cptnwinky, your method would not always work. For example, if it was the 26th of a month, the date would end up being the 36th etc.
__________________ Please login or register to view this content. Registration is FREE - Latest Articles: Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE
That is basically the same thing cptnwinky did. If you add 10 to 23, you get 33. There is no 33rd of any month.
__________________ Please login or register to view this content. Registration is FREE - Latest Articles: Please login or register to view this content. Registration is FREE , Please login or register to view this content. Registration is FREE