0

I have a function what is convert the video duration example = 856.7 is 14:17

function duration( $duration )
{
    $duration_formated  = NULL;
    $duration           = round($duration);
    if ( $duration > 3600 ) {
        $hours              = floor($duration/3600);
        $duration_formated .= sprintf('%02d',$hours). ':';
        $duration           = round($duration-($hours*3600));
    }
    if ( $duration > 60 ) {
        $minutes            = floor($duration/60);
        $duration_formated .= sprintf('%02d', $minutes). ':';
        $duration           = round($duration-($minutes*60));
    } else {
        $duration_formated .= '00:';
    }

    return $duration_formated . sprintf('%02d', $duration);
}

but how i can convert 14:17 to show me the video duration 856.7

Matei Zoc
  • 3,739
  • 3
  • 16
  • 18
  • possible duplicate of [Convert HH:MM:SS to seconds only?](http://stackoverflow.com/questions/4834202/convert-hhmmss-to-seconds-only) – alergy Feb 05 '15 at 16:37
  • i check that question but is not what i need ... what i need is to convert 14:77 to be 856:7 ( video duration ) – Matei Zoc Feb 05 '15 at 17:04

0 Answers0