PHP strptime() 函数
PHP 教程
· 2019-01-24 09:13:34
实例
解析由 strftime() 生成的时间/日期:
<?php
$format="%d/%m/%Y %H:%M:%S";
$strf=strftime($format);
echo("$strf");
print_r(strptime($strf,$format));
?>
$format="%d/%m/%Y %H:%M:%S";
$strf=strftime($format);
echo("$strf");
print_r(strptime($strf,$format));
?>
定义和用法
strptime() 函数解析由 strftime() 生成的时间/日期。
注意:该函数不能在 Windows 平台下实现!
语法
strptime(date,format);
| 参数 | 描述 |
|---|---|
| date | 必需。要解析的字符串(例如:由 strftime() 返回的)。 |
| format | 必须。规定日期中要使用的格式:
|
技术细节
| 返回值: | 如果成功该函数返回一个带有解析日期的数组。如果失败则返回 FALSE。
返回数组的键名含义如下所示:
|
|---|---|
| PHP 版本: | 5.1+ |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Once Upon an Algorithm
Martin Erwig / MIT Press / 2017-9-8 / GBP 22.95
How Hansel and Gretel, Sherlock Holmes, the movie Groundhog Day, Harry Potter, and other familiar stories illustrate the concepts of computing. Picture a computer scientist, staring at a screen and......一起来看看 《Once Upon an Algorithm》 这本书的介绍吧!