Reputation: 30168
I need to take a variable of the current month (in this case output as the number "1") - and output it is the numbers "02" and "03". I'm trying to do this:
<?php $current_month = "{current_time format="%m"}";
$next_month = "0".$current_month++;
$third_month = "0".$next_month++;
?>
but this is changing the original variable, which I don't want to do. How do I accomplish this?
Thanks for the help.
Upvotes: 0
Views: 205
Reputation: 165261
Just use + 1
:
<?php
$current_month = "{current_time format="%m"}";
$next_month = "0". ($current_month + 1);
$third_month = "0". ($next_month + 2); ?>
Upvotes: 3