View Single Post
ישן 27-10-08, 21:32   # 4
Sagi
חבר וותיק
 
Sagi's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 1,745
שלח הודעה באמצעות ICO אל Sagi

Sagi לא מחובר  

PHP קוד:
function GetFLVDuration($file){
  
// get contents of a file into a string
  
if (file_exists($file)){
    
$handle fopen($file"r");
    
$contents fread($handlefilesize($file));
    
fclose($handle);
    
//
    
if (strlen($contents) > 3){
      if (
substr($contents,0,3) == "FLV"){
        
$taglen hexdec(bin2hex(substr($contents,strlen($contents)-3)));
        if (
strlen($contents) > $taglen){
          
$duration hexdec(bin2hex(substr($contents,strlen($contents)-$taglen,3)))  ;
          return 
$duration;
        }
      }
    }
  }
  return 
false;

  Reply With Quote