Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
//create an array of the months
$month_list = array('January', 'February', 'March',
'April' , 'May' , 'June' ,
'July' , 'August' , 'September',
'October', 'November' , 'December');
//Get the current month as an integer
//and the current year as a four digit integer.
//Assign them to $month and $year variables
//These variables can be set from user input
//or as in this case from PHP.
[url=http://us3.php.net/manual/en/function.list.php]list[/url]($month, $year) = [url=http://us3.php.net/manual/en/function.explode.php]explode[/url](':',[url=http://us3.php.net/manual/en/function.date.php]date[/url]('n:Y'));
//array_slice($month_list, $month-1) = an array starting
//with '$month' and ending with December.
$current_year = [url=http://us3.php.net/manual/en/function.array-slice.php]array_slice[/url]($month_list, $month-1);
//array_slice($month_list, 0, $month-1) = an array starting
//with 'January' and ending with the month before
//the start month.
$next_year = array_slice($month_list, 0, $month-1));
//To make one array of months in the proper order you can
//use array_merge()
$ordered_months = [url=http://us3.php.net/manual/en/function.array-merge.php]array_merge[/url]($current_year, $next_year);
?>
$next_year = array_slice($month_list, 0, $month-1)[COLOR=red])[/color];