I have this code to show video duration in my app.
$duration = 23; // seconds
$duration = gmdate("H:i:s", $duration);
The above code outputs 00:00:23 but hours field is not required since it is just 23 seconds, I would like it to show 00:23 seconds, and if the video length is more than hour for example, it should show 01:24:19
Any idea?
Thanks