| Viewed 187 times

how to get the previous date in PHP


how to get the previous date in PHP

PHP
1 Answer
Mohammad Qandeel
Answered
10

to get the previous date you can use strtotime() function 

example

<?php
echo date('Y-m-d' , strtotime('-1 day')); 
?>

  the output will be the previous date 

 



Related Questions