How to print day with number in php

Hi,
you can simply use the DateTime object:

$myDate = new DateTime("2022/03/04");
echo $myDate->format('N, l');

It will show Number, and Day Name:
https://www.php.net/manual/en/datetime.format.php

1 Like