how to subtract days to date in php

In this tutorial i will show you how to subtract days to date in PHP. Many project need this type specialize so, let’s start in code so you are easily understand how to subtract days. You may also like How to add one year in current date using php and How to get Yesterday Date in PHP.

php subtract date from today

The following source code will subtract 2 days to current date.

<?php
echo date('Y/m/d',strtotime("-2 days"));
?>

The following source code will subtract2 days to date.

<?php
    $date = "2019-05-19";
    echo date('Y-m-d', strtotime($date. ' - 2 days'));
?>

And if you like this tutorials please share it with your friends via Email or Social Media.

Leave a Reply

Your email address will not be published. Required fields are marked *