How to get the first day of the week in PHP
by
Anuj Kumar
In this tutorial, We will learn How to get on the first day of the week. We will use the strtotime()
function to get the first day of the week. It will return returns the timestamp of the default time variable, then uses date()
function to convert the date from the timestamp to a meaningful date.
|
<?php setlocale(LC_TIME, "English"); $firstDay = strftime("%A - %d/%M/%Y", strtotime("this week")); echo "First day of this week is: ", $firstDay; ?> |
Tags: How to get the first day of the week in PHP
Anuj Kumar
Hi! I am Anuj Kumar, a professional web developer with 5+ years of experience in this sector. I found PHPGurukul in September 2015. My keen interest in technology and sharing knowledge with others became the main reason for starting PHPGurukul. My basic aim is to offer all web development tutorials like PHP, PDO, jQuery, PHP oops, MySQL, etc.
Apart from the tutorials, we also offer you PHP Projects, and we have around 100+ PHP Projects for you.
Recommended Tutorials for you
You may also like...