Get the days of the current week PHP

3

How can I get the days of the current week? Eg This week I would like to show the following sentence:

  

Events from the 15th to the 19th of October

While on 16/10, continue showing from the 15th to the 19th of October. I tried the code below, but when I change the date, it marks the date it was changed.

$p = strtotime("0 week");
echo date('d/m/Y', $p)."<br>";
$u = strtotime("4 days");
echo date('d/m/Y', $u)."<br>";

I also tried this way:

echo date("d-m-Y",strtotime("last Monday"));
echo "<br>";
echo date("d-m-Y",strtotime("next Friday"));

I understand that the problem may be in date('d/m/Y',...) , but how can I resolve this?

    
asked by anonymous 15.10.2018 / 17:18

1 answer

2

You can do the following:

$segunda = date('d/m/Y', strtotime('monday this week'));  // 15/10/2018
$sexta = date('d/m/Y', strtotime('friday this week'));  // 19/10/2018
    
15.10.2018 / 17:50