php date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
matthew0786
Forum Newbie
Posts: 9
Joined: Sat Feb 28, 2009 8:01 am

php date

Post by matthew0786 »

Ok, i have a variable defined for example

Code: Select all

$month = January
How do i change the value (for example add 1 month to $month to become February). Is there such a function to add months ??
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: php date

Post by susrisha »

User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: php date

Post by McInfo »

Code: Select all

<?php
$month = 'February';
echo date('F', strtotime($month.' +1 month')); // March
?>
Edit: This post was recovered from search engine cache.
Post Reply