How to Get the First Day Of Specific Month In Php ?
Jan 11, 2021
Hi Guys,
In this example,I will learn you how to get the first day of specific month in php.you can easy and simply get the first day of specific month in php.
Sometimes we need How to get the first day of a month from a specific date in php for various purposes. We can do it in many ways.
Example:
<?php
$query_date = '2021-01-10';
// First day of the month.
echo date('Y-m-01', strtotime($query_date));
?>
Output:
2021-01-01
It will help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example