I’m beginner in PHP and I’m trying to learn. I want to get the date of the next four days in Laravel. I tried like this but it returns the date four days later.
$days = date('Y-m-d', strtotime(' +4 day'));
I want to take all the next four days. How can I show all the next four days in the blade?
Advertisement
Answer
I hope this will help you out
$days = []; for ($i = 0; $i <= 4; $i++) { $days[] = date("D", strtotime("$i day")); } var_dump($days);