php 秒转时分秒

 function secToTime($times){
            $time = gmstrftime('%H时%M分%S秒',1);
            $time = preg_replace("/00时|00分/", "",$time);

            $time = preg_replace_callback("/(\d{1,})/",
                function($matches) {
                    return intval($matches[0]);
                },$time);
            return $time;
        }

你可能感兴趣的:(php 秒转时分秒)