function isdate($str, $format = "Y-m-d") { $strArr = explode ( "-", $str ); if (empty ( $strArr )) { return 0; } foreach ( $strArr as $val ) { if (strlen ( $val ) < 2) { $val = "0" . $val; } $newArr [] = $val; } $str = implode ( "-", $newArr ); $unixTime = strtotime ( $str ); $checkDate = date ( $format, $unixTime ); if ($checkDate == $str) return 1; else return 0; }
{ 超级计算机囧囧囧 }
近期评论