How to convert 00:00:23 to 00:23 using PHP gmdate function
<p>I have this code to show video duration in my app.</p>

<pre><code>$duration = 23; // seconds
$duration = gmdate("H:i:s", $duration);
</code></pre>

<p>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</p>

<p>Any idea?</p>

<p>Thanks</p>
