display array elements modulo 5?
<p>I have an array which is converted to string and it looks like this: <code>00:00,05:00,10:00,15:00,20:00</code> it shows hours range every 5 hours,
I want to display my string like this <code>, , , ,5:00, , , , ,10:00, , , , ,15:00, , , , ,20:00, , , ,</code>
so display it every 5 hours but hours that are not needed i want to set empty,</p>

<p>code:</p>

<pre><code>    $date = new \DateTime("12:00am");
    $dv = new \DateInterval('PT5H');
    $totalInterval = 4 ; 
    $dr = array();
    $date-&gt;format('H:i');
    for($i = 0; $i &lt; $totalInterval; $i++)
    {

        $dr[] = $date-&gt;format('H:i');
        $date-&gt;add($dv);

    }
    $dr[] = $date-&gt;format('H:i');   
    $dr = implode (',', $dr); 
</code></pre>

<p>How would I do that ?</p>
