Mengkonversi durasi video youtube Api v3 menggunakan php


Contoh kode PHP :

function covtime($youtube_time){
    $start = new DateTime('@0'); // Unix epoch
    $start->add(new DateInterval($youtube_time));
    return $start->format('H:i:s');
}   

echo covtime('PT2H34M25S');//output 02:34:25
Smoga bermanfaat !!


Previous
Next Post »