时间转换成秒数 * 时间转换成秒数,类似时间戳
* @param string $time
* @return int
*/
public static function timeToSec($time) {
$p = explode(':',$time);
$c = count($p);
if ($c>1) {
$hour = intval($p[0]);
$minute = intval($p[1]);
$sec = intval($p[2]);
} else {
throw new Exception('error time format');
}
$secs = $hour*3600 + $minute*60 + $sec;
return $secs;
}