Collecting data from different positions in a given array
Should work (at least it doesn't look like a riddle anymore:)

for ($i = 0; $i &lt; 4; $i++) {
    $a = $i + 9;
    $b = 3 + $i * 4;

    $r[] = array(
        'na'   =&gt; $arr[$a][2],
        'pr'   =&gt; $arr[$a][3],
        'cu'   =&gt; $arr[$a][3],
        'val1' =&gt; $arr[6][$b],
        'val2' =&gt; $arr[5][$b],
        'val3' =&gt; $arr[4][$b]
    );
}


if $r[..]['cu'] is some function result assign to function call directly.