PHP 校验日期格式是否合法 Jackey PHP 2019-01-07 700 次浏览 PHP, 日期 [codesyntax lang="php"] /** * 校验日期格式是否合法 * @param string $date * @param array $formats * @return bool */ function isDateValid($date, $formats = array('Y-m-d', 'Y/m/d', 'Y/n/j')) { $unixTime ...
PHP 今日、昨日、本周、上周、本月常用起始时间戳和结束时间戳的时间处理类 Jackey PHP 2018-12-15 1,520 次浏览 PHP, 日期, 时间戳 [codesyntax lang="php"] <?php class Time { /** * 返回今日开始和结束的时间戳 * * @return array */ public static function today() { return [ mktime(0, 0...