Kanishka Panamaldeniya Kanishka Panamaldeniya - 1 year ago 64
PHP Question

is there a way to get month name by giving an integer value PHP

hi i am using PHP i want to pass an integer value (1-12) and get corresponding month name , is there a way in PHP to do that or i have to do t my own by initialize a month names array.

i want to do like

$month_name = get_month_name(1);

echo $month_name ; //echo january

thanks in advance

Answer Source
echo date('F', strtotime("2012-$int-01"));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download