How To Display Today, Tomorrow and yesterday Date in php

How To Display Today, Tomorrow and yesterday Date in PHP: One of the great functions of PHP is the date function. It can be used to display date. This tutorial will show you an easy way to output today, tomorrow and yesterday date.


How To Display Today, Tomorrow and yesterday Date in PHP


The syntax for display today date :


<!DOCTYPE html>
<html>
<body> 

<?php 

echo "Today date is :";
echo date("Y-m-d",strtotime("today")); 
?> 

</body> 

</html>


The syntax for display yesterday date :

<!DOCTYPE html>
<html>
<body>

<?php
echo "Yesterday Date is : ";
echo date("Y-m-d",strtotime("yesterday"));
?>

</body>
</html>



The syntax for display Tomorrow date :


<!DOCTYPE html>

<html>
<body>

<?php

echo "Tomorrow date is :";
echo date("Y-m-d",strtotime("tomorrow"));
?>

</body>

</html>
How To Display Today, Tomorrow and yesterday Date in php How To Display Today, Tomorrow and yesterday Date in php Reviewed by Ritesh Vishwakarma on August 27, 2018 Rating: 5

No comments:

Powered by Blogger.