
- PHP 7 Tutorial
- PHP 7 - Home
- PHP 7 - Introduction
- PHP 7 - Performance
- PHP 7 - Environment Setup
- PHP 7 - Scalar Type Declarations
- PHP 7 - Return Type Declarations
- PHP 7 - Null Coalescing Operator
- PHP 7 - Spaceship Operator
- PHP 7 - Constant Arrays
- PHP 7 - Anonymous Classes
- PHP 7 - Closure::call()
- PHP 7 - Filtered unserialize()
- PHP 7 - IntlChar
- PHP 7 - CSPRNG
- PHP 7 - Expectations
- PHP 7 - use Statement
- PHP 7 - Error Handling
- PHP 7 - Integer Division
- PHP 7 - Session Options
- PHP 7 - Deprecated Features
- PHP 7 - Removed Extensions & SAPIs
- PHP 7 Useful Resources
- PHP 7 - Quick Guide
- PHP 7 - Useful Resources
- PHP 7 - Discussion
How to get first day of week in PHP?
To get the first day of the week in PHP, the code is as follows −
Example
<?php $res = date('l - d/m/Y', strtotime("this week")); echo "First day = ", $res; ?>
Output
This will produce the following output −
First day = Monday - 09/12/2019
Example
Let us now see another example −
<?php echo "Displaying Sunday as first day of a week...
"; $res = date('l - d/m/Y', strtotime("sunday 0 week")); echo "First day (next week) = ", $res; ?>
Output
This will produce the following output −
Displaying Sunday as first day of a week... First day (next week) = Sunday - 15/12/2019
- Related Articles
- How to get first day of the week using Python?
- How to get beginning of the first day of this week from timestamp in Android sqlite?
- How to get the day of the week in JavaScript?
- Get the week number in MySQL for day of week?
- Get Day Number of Week in Java
- C# Program to get current day of week
- How to set the first day of each week to weekday using Python?
- Java Program to get day of week as string
- How to set the first day of the week in sap.m.DatePicker's calendar?
- How to get day of month, day of year and day of week in android using offset date time API class?
- Java Program to get day of week for the last day of each month in 2019
- How to get the first day of next month in MySQL?
- How to get first day of every corresponding month in MySQL?
- Java Program to get the day of the week from GregorianCalendar
- Get localized short day-in-week name in Java

Advertisements