I need to display to user a list of localized day names (like \'Monday\', \'Tuesday\', ...) in a form. I know ho to get day name of any date. But is there a particular and f
setlocale(LC_TIME, 'de_DE');
$today = ( 86400 * (date("N")) );
for( $i = 0; $i < 7; $i++ ) {
$days[] = strftime('%A', time() - $today + ($i*86400));
}
print_r($days);
Obviously can be optimised by not calling time() 7 times etc but that's the gist. It gives you the right language for the locale and keeps Sun-Sat order of the array in tact.