Get Month name in PHP

by satheeshkumar 2014-06-03 17:35:22

The below function is used to get the month name usinh PHP,
<?php
function get_month_name($month)
{
 return date("F", strtotime(date("d-$month-y")));
}

$dates = date("Y-m-d");//replace your dates
$date = explode('-', $dates);
$monName = get_month_name($date[1]);
echo $monName;
?>
In above example it prints the current month name 'June'.

Tagged in:

637
like
0
dislike
0
mail
flag

You must LOGIN to add comments