Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get first and last day of previous month

date('Y-m-01', strtotime('last month'));
date('Y-m-t', strtotime('last month'));
Comment

get last month php

$currentMonth = date('M');// if number, then date('m');
//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
Comment

php get current month first date

//get first day of the current month 
$start = date("Y-m-1 00:00:00");
//get current date of the month
$end = date("Y-m-d H:i:s");

//query data for the current month so far
$query = $this->db_model->run_query("select column_1, column_2 from table where date_column BETWEEN '".$start."' AND '".$end."'");
Comment

php date first day of month and last month

$first = date('Y-m-01', strtotime('last month'));
$last = date('Y-m-t', strtotime('last month'));
Comment

get month first date and last date in php

$first_day_this_month = date('m-01-Y'); // hard-coded '01' for first day
$last_day_this_month  = date('m-t-Y');
Comment

get last month using php

//Last month
$lastMonth = Date("F", strtotime("first day of previous month");
$nextMonth = Date("F", strtotime("first day of next month");
Comment

PREVIOUS NEXT
Code Example
Php :: how to add values to an array in laravel 
Php :: get data in descending order in laravel 
Php :: How do I get the current date and time in PHP? 
Php :: laravel get items by ids 
Php :: total days between two dates carbon 
Php :: file storage laravel 
Php :: laravel collection transform 
Php :: ternary operator in php 
Php :: Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 
Php :: laravel image validate 
Php :: scribe laravel 
Php :: How do I convert a string to a number in PHP? 
Php :: php uppercase first letter 
Php :: how to remove null values in array php 
Php :: Laravel retrieving single record 
Php :: how to send data from one website to another in php 
Php :: localhost didn’t send any data 
Php :: compare two arrays and return the difference php 
Php :: laravel update model from request 
Php :: php catch all exceptions 
Php :: get permalink by id wordpress 
Php :: array collapse laravel 
Php :: base64 enocode php 
Php :: php timezone 
Php :: laravel search user details by specific role 
Php :: how to get last id in database codeigniter 4 
Php :: laravel get all records order by 
Php :: php get date between two dates 
Php :: laravel nested query builder 
Php :: laravel target class does not exist 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =