5

How to get Day Name from date in PHP?

$dateValue='2015/07/15';
$dayName=date("D", strtotime($dateValue);

Hi, I want exact day name from the above given sample date, please help me.

Sougata Bose
  • 31,517
  • 8
  • 49
  • 87
siva
  • 593
  • 3
  • 8
  • 19

2 Answers2

4

You need to use l as the first parameter.

echo date('l', strtotime($dateValue));

Daan
  • 12,099
  • 6
  • 34
  • 51
3

You can use the following code,

echo date('l', strtotime($dateValue));

for more details, refer following link:

http://www.w3schools.com/php/func_date_date.asp

Niranjan N Raju
  • 12,047
  • 4
  • 22
  • 41