输入进来的时间戳如何检查合法性?如下函数即可:

function isValidTimeStamp($timestamp){
return ((string) (int) $timestamp === $timestamp)
&& ($timestamp <= PHP_INT_MAX)
&& ($timestamp >= ~PHP_INT_MAX);
}

函数整理自:http://stackoverflow.com/questions/2524680/check-whether-the-string-is-a-unix-timestamp

Related Posts: PHP检查时间戳合法性 :