扫码一下
查看教程更方便
返回解析日期字符串时的警告和错误:
<?php
date_create("gyuiyiuyui%&&/");
print_r(date_get_last_errors());
?>
执行结果
Array
(
[warning_count] => 1
[warnings] => Array
(
[6] => Double timezone specification
)
[error_count] => 5
[errors] => Array
(
[0] => The timezone could not be found in the database
[10] => Unexpected character
[11] => Unexpected character
[12] => Unexpected character
[13] => Unexpected character
)
)
date_get_last_errors() 函数返回解析日期字符串时找到的警告/错误。
date_get_last_errors();