<?php
$myDate = "19-sept-2014";
$which_day = DateTime::createFromFormat('d-M-Y', $myDate);
echo "Which Day > " . $which_day->format('N');
?>
N -> Refers to day number in the week.
0-Sunday
1-Monday
2-Tuesday
3.Wednesday
4.Thursday
5.Friday
6.Saturday
Output for the above script is: Which Day > 5
$myDate = "19-sept-2014";
$which_day = DateTime::createFromFormat('d-M-Y', $myDate);
echo "Which Day > " . $which_day->format('N');
?>
N -> Refers to day number in the week.
0-Sunday
1-Monday
2-Tuesday
3.Wednesday
4.Thursday
5.Friday
6.Saturday
Output for the above script is: Which Day > 5
0 comments:
Post a Comment