For Loop Custom Fields
<p>i need help for this task.</p>

<p>i need a for loop who picks the closest duration</p>

<p>sample we have a duration with 120 seconds the 120 seconds are on every calculation divided by 8
so here is an example</p>

<p>120 Duration</p>

<p>Here are the 8 closest values
15
30
45
60
75
90
105
120</p>

<p>How i can realize this i have all tested</p>

<pre><code>&lt;?php
$count = 1;
$duration = 120;
$temp = 0;
for ($x = 1; $x &lt; 120; $x++) {
    #$j = $x / 8;
    $temp = $x / 8;
    echo '&lt;pre&gt;' . ($temp) . '&lt;/pre&gt;';

    if ($count == 8) {
        break;
    }
    $count++;
}
?&gt;
</code></pre>
