php date day name code example

Example 1: php get day from date

$timestamp = strtotime('2009-10-22');

$day = date('D', $timestamp);
var_dump($day);

Example 2: php full day name

date("l",time()) // LOWER CASE L

Example 3: name of today php

$datetime = DateTime::createFromFormat('YmdHi', '201308131830');
echo $datetime->format('D');

// or 

$date = new \DateTime();
echo $date->format("D");

Example 4: long day in php

$mydate = '2016-01-01';
echo date('l, F jS, Y', strtotime($mydate));
# Friday, January 1st, 2016

Tags:

Php Example