ItSolutionStuff.com

How to Get Full Day Name from Date in PHP?

By Hardik Savani • May 14, 2024
PHP

This is a short guide on how to get full day name from date in php. i would like to show you php date get full day name. In this article, we will implement a php date get day name. We will look at example of php get day name from date.

I will give you very simple example how to get day name from date in PHP. so let's see both example with output:

Example 1: PHP Get Day Name from Date

index.php

<?php

$date = "2021-02-02";

$newDate = date('l', strtotime($date));

echo $newDate;

?>

Output:

Tuesday

Example 2: PHP Get Day Name from Current Date

index.php

<?php

$newDate = date('l');

echo $newDate;

?>

Output:

Monday

Example 3: PHP Get Day Name from Number

index.php

<?php

$numericDay = "1";

$newDate = date('l', strtotime("Sunday +{$numericDay} days"));

echo $newDate;

?>

Output:

Monday

i hope it can help you...

Tags: PHP
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Get Next Month Date in PHP?

Read Now →

How to Get Tomorrow Date in PHP?

Read Now →

How to Get Yesterday Date in PHP?

Read Now →

PHP Subtract Seconds from Time Example

Read Now →

How to Subtract Minutes from DateTime in PHP?

Read Now →

How to Subtract Hours from DateTime in PHP?

Read Now →

How to Add Seconds to Time in PHP?

Read Now →

PHP Add Minutes to Time Example

Read Now →

PHP Add Hours to Datetime Example

Read Now →