1
0
Fork 0
php-coding/10.test2.php

13 lines
531 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/*
* 显示周几不同国家的语言设定原教程中的strftime在高php版本上弃用
*/
$dateTime = new DateTime();
$formattedDate = IntlDateFormatter::formatObject($dateTime, 'EEEE','en_US');
echo $formattedDate;
$formattedDate = IntlDateFormatter::formatObject($dateTime, 'EEEE','zh_CN');
echo $formattedDate;
$formattedDate = IntlDateFormatter::formatObject($dateTime, 'EEEE','zh_HK');
echo $formattedDate;
$formattedDate = IntlDateFormatter::formatObject($dateTime, 'EEEE','ja_JP');
echo $formattedDate;