How to get an upcoming date with a preset start date [PHP]

<?
$startDate = "2010-06-02";
$nextDate = strtotime($startDate. "+2 week");
$format = '%Y-%m-%d';
echo strftime($format,$nextDate);
?>

Live example of above code.

Leave a comment

7 Comments.

  1. Can you just copy this code to anywhere on the page and upload to the site? Or is there more to it than that?

  2. are there any common reasons why it wouldn’t work. I pasted the code in between tags and removed the tags. the syntax still looks correct?

  3. my last message didn’t look like it was supposed too. It removed my tags.

    “are there any common reasons why it wouldn’t work. I pasted the code in between p tags and removed the br tags.”

    I don’t get an error message, its just like nothing is there. weird

Leave a Reply

You must be logged in to post a comment.