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

php get end date of month

// First date of the month.
$monthFirstDate = date('Y-m-01', strtotime('today'));

// Last date of the month.
$monthLastDate = date('Y-m-t', strtotime('today'));

// Second last date of the month
$monthLastSecondDate = date('Y-m-d', strtotime('-2 day', strtotime('today')));
Comment

last day of previous month in php

$lastDay = date('t',strtotime('last month'));

print_r($lastDay);
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

getting last day of next month in php

$lastDateOfNextMonth =strtotime('last day of next month') ;

$lastDay = date('d/m/Y', $lastDateOfNextMonth);

 

print_r($lastDay);
Comment

php last day of month

$a_date = "2009-11-23";
echo date("Y-m-t", strtotime($a_date));
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 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

php get last day of month

$lastOfMonth = date('Y-m-t');
Comment

check if is the last day of the month php

if(gmdate('t') == gmdate('d')){
    echo 'Last day of the month.';
}
Comment

PREVIOUS NEXT
Code Example
Php :: if statement in laravel blade 
Php :: Using the PHPExcel library to read an Excel file and transfer the data into a database 
Php :: php value in array 
Php :: laravel basic login 
Php :: How to Auto Backup Mysql Database Using PHP Script 
Php :: laravel pagination limit page 
Php :: woocommerce my account php code wordpress 
Php :: call_user_func() 
Php :: lastinsertId php 
Php :: Securing form from possible sql injection 
Php :: insert array values in database using codeigniter 
Php :: laravel CORS config `allowed_origins` should be an array 
Php :: get users by role name - spatie/laravel-permission 
Php :: laravel one to many relationship 
Php :: Rename route resource in laravel 
Php :: laravel collection intersect 
Php :: strtotime php 
Php :: catch warning php 
Php :: add floater to open a modal in wordpress 
Php :: permutation and combination program in php 
Php :: laravel call controller method from another controller 
Php :: create config value file in php 
Php :: php get locale active 
Php :: conditional validation laravel based on role 
Php :: twig render string 
Php :: bootstrap autocomplete example laravel 
Php :: Before Action methoond in Yii 1 controller 
Php :: log php 
Php :: required_unless laravel 
Php :: php call non static method from static method 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =