Rumah >pembangunan bahagian belakang >tutorial php > 哪位兄弟能帮忙注解一下这段程序?该怎么处理
哪位兄弟能帮忙注解一下这段程序?
功能是取得flv视频的时间,是网上找的,但是很多地方不明白。。。
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> function BigEndian2Int($byte_word, $signed = false) { $int_value = 0; $byte_wordlen = strlen($byte_word); for ($i = 0; $i $flv_header_frame_length) { fseek($fp, $frame_size_data_length - $flv_header_frame_length, SEEK_CUR); } $duration = 0; while ((ftell($fp) + 1) $duration) { $duration = $timestamp; } fseek($fp, $next_offset, SEEK_SET); } fclose($fp); return $duration; } //转化为0:03:56的时间格式 function fn($time){ $num = $time; $sec = intval($num/1000); $h = intval($sec/3600); $m = intval(($sec%3600)/60); $s = intval(($sec%60)); $tm = $h.':'.$m.':'.$s; return $tm; } $t = getTime("/tmp/907701336.flv");//显示数字时间如236722 echo fn($t);//显示时间格式0:03:56