Posted By

dsoms on 04/12/11


Tagged

php day date week


Versions (?)

Get day of week


 / Published in: PHP
 

  1. // Date format (yyyy/mm/dd)
  2.  
  3. function getWeekDay($date)
  4. {
  5. $date = str_replace("/","-", $date);
  6. list($year, $month, $day) = explode("-", $date);
  7. $week_day = date("w", mktime(0, 0, 0, $month, $day, $year));
  8. return $week_day;
  9. }

Report this snippet  

You need to login to post a comment.