Fixed,
I set the months using:
Which sets it to the month date 1 - January / 12 - December.
Example array:
Code:
$retrived_months = array("6", "1", "12");
I Then ordered that array using the command below:
Code:
asort($retrived_months);
This would give the months in numerical order.
Code:
$retrived_months = array("1", "6", "12");
I then made a simple function to convert the numerical to the word:
Code:
foreach($retrived_months as $key => $value){getmonth($value)." ";}
Which resulted in:
Code:
January June December
Function
Code:
function getmonth($value)
{
switch($value){
case '1':
$month = "January";
break;
case '2':
$month = "February";
break;
case '3':
$month = "March";
break;
case '4':
$month = "April";
break;
case '5':
$month = "May";
break;
case '6':
$month = "June";
break;
case '7':
$month = "July";
break;
case '8':
$month = "August";
break;
case '9':
$month = "September";
break;
case '10':
$month = "October";
break;
case 11:
$month = "November";
break;
case 12:
$month = "December";
break;
}
return $month;
}
Which returned the Month 1 as January / Month 6 as June... Etc..
Just as i needed!
Is there a cleaner way of doing it?
Hope this helps anyone else trying to achive a similar thing!
Marty
Recent comments
11 hours 44 min ago
21 hours 12 min ago
22 hours 1 min ago
1 day 1 hour ago
1 day 5 hours ago
1 day 6 hours ago
1 day 8 hours ago
1 day 18 hours ago
1 day 23 hours ago
2 days 57 min ago