PHP date_parse_from_format() 函数
实例
根据指定的格式返回一个包含指定日期信息的关联数组:
<!DOCTYPE html><html><body><?phpprint_r(date_parse_from_format("mmddyyyy","25092016"));echo "<br><br>";print_r(date_parse_from_format("j.n.Y H:iP","1.9.2021 14:35+02:00"));?></body></html>
定义和用法
date_parse_from_format() 函数根据指定的格式返回包含指定日期信息的关联数组。
语法
date_parse_from_format(format,date);
| 参数 | 描述 |
|---|---|
| format | 必需。规定格式(date_create_from_format() 接受的格式)。 |
| date | 必需。指定日期,字符串值。 |
技术细节
| 返回值: | 如果成功则返回包含指定日期信息的关联数组。 |
|---|---|
| PHP 版本: | 5.3+ |