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
matthew0786
Forum Newbie
Posts: 9 Joined: Sat Feb 28, 2009 8:01 am
Post
by matthew0786 » Mon May 04, 2009 4:02 am
Ok, i have a variable defined for example
How do i change the value (for example add 1 month to $month to become February). Is there such a function to add months ??
susrisha
Forum Contributor
Posts: 439 Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India
Post
by susrisha » Mon May 04, 2009 4:04 am
McInfo
DevNet Resident
Posts: 1532 Joined: Wed Apr 01, 2009 1:31 pm
Post
by McInfo » Mon May 04, 2009 1:51 pm
Code: Select all
<?php
$month = 'February';
echo date('F', strtotime($month.' +1 month')); // March
?>
Edit: This post was recovered from search engine cache.