Php Get Day of Week - Php

How to get a day of the week from date using php code?

Snippet Code


  
Rate this page :
  [ 0 votes]

Date() function is used to get the day of the week from date. Here, date("l") will return output like Tuesday and date("D") will return output like Tue.

<?php function day_of_week($date) { $op = date('l', strtotime($date)); //$op = date('D', strtotime($date)); return $op; } echo day_of_week('2015-06-23'); ?>

Tags


Ask Questions

Ask Question