📄 03c05-1.php
字号:
<?php// Set the default timezone to US/Eastern time:date_default_timezone_set('US/Eastern');// Simulate reading an Apache log file, with the following line:$logline = '127.0.0.1 - - [02/Nov/2005:22:04:41 -0500] "GET / HTTP/1.1" 200 41228';// Since we only want the date section, use regex to obtain it:$matches = array();preg_match('/\[(.*?)\]/', $logline, $matches);// Take the date, and convert it:$timestamp = strtotime($matches[1]);// Now echo it out again to ensure that we read it correctly:echo date(DATE_RFC1123, $timestamp);?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -