Search
 
SCRIPT & CODE EXAMPLE
 

PHP

last day of previous month in php

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

print_r($lastDay);
Comment

how to get previous month in php

echo date('M Y', strtotime("-1 month"));
//to get date with time of previous month
echo date("Y-m-d H:i:s",strtotime("-1 month"));
Comment

previous month number in php

<?php
    $date = "2020-01-11";
    $newdate = date("Y-m-d", strtotime ( '-1 month' , strtotime ( $date ) )) ;
    echo $newdate;
?>
Comment

php date function get previous month

$tgl = '25 january 2012';

$prevmonth = date("M Y",mktime(0,0,0,date("m", strtotime($tgl))-1,1,date("Y", strtotime($tgl))));
echo $prevmonth;
Comment

PREVIOUS NEXT
Code Example
Php :: laravel check pagination in blade 
Php :: laravel print query with parameters 
Php :: datediff in hour query builder laravel 
Php :: wordpress acf get field 
Php :: php check if associative array is null 
Php :: laravel queue work on shared hosting 
Php :: inner join codeigniter 
Php :: laravel get session variable in controller 
Php :: convert a php array into a javascript array 
Php :: mac os change the php verison 
Php :: laravel url previous 
Php :: php usort keep keys 
Php :: create user with tinker php laravel 
Php :: check if date is past php 
Php :: print url in view yii2 
Php :: laravel auth namespace 
Php :: carbon random future date 
Php :: wpdb-prepare 
Php :: php cookie never expire 
Php :: console log in php 
Php :: how to use multiple where condition in codeigniter 
Php :: read-json-data-response-using-php 
Php :: laravel current date in migration 
Php :: larevel version artisan 
Php :: update onlu one column laravel 
Php :: increase memory laravel controller 
Php :: wordpress is admin 
Php :: laravel get current action name 
Php :: deactivate plugin wp cli 
Php :: laravel 8 change password 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =