I saw that strftime is deprecated in PHP 8.1. I saw I can use a class include in intl but I'm not sure to understand how to use It.
On my site I use this function with the array $datesToConvert{020222, 030222, ...} which means "02 Février 2022"
function compareDate($date1, $date2){
return strtotime($date2) - strtotime($date1);
}
usort($datesToConvert, "compareDate");
//Generate Array titles and Array
foreach($datesToConvert as $element){
$titles[] = "Vidéo du " . strftime('%d', strtotime($element)) . " " . ucfirst(strftime('%B', strtotime($element)));
}
The Output is like "Vidéo du 02 Février"
May I have to rewrite my code in another way ?
Regards.
ps : sorry for my poor english i'm french.
strftime
andgmstrftime
functions are deprecated - PHP 8.1 • PHP.Watch \$\endgroup\$