You can use the following code to get yesterday’s date in PHP. To do this, we are using PHP’s built-in date() function.
<?php echo date("Y-m-d", time() - (60*60*24) ); ?> <?php echo date("Y-m-d", strtotime("-1 day")); ?> <?php echo date("Y-m-d", strtotime("yesterday")); ?> <?php echo date("Y-m-d", mktime(0, 0, 0, date("m"),date("d")-1,date("Y"))); ?>
0 comments:
Post a Comment