3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php array( 0 => array( "a" => "r1", "b" => "c1", "c" => "d1", ), 1 => array( "a" => "r1", "b" => "c1", "c" => "d2", ), 2 => array( "a" => "r1", "b" => "c1", "c" => "d3", ), 3 => array( "a" => "r1", "b" => "c2", "c" => "d1", ), 4 => array( "a" => "r1", "b" => "c2", "c" => "d3", ), 5 => array( "a" => "r1", "b" => "c3", "c" => "d1", ) ); $count = 0; for($i=1; $i<=3; $i++){ for($j=1; $j<=3; $j++){ $data[$count] = array( 'a' => '', 'b' => 'D'.$j, 'c' => 'C'.$i ); for($r=0; $r<9; $r++){ if(isset($rows[$r]) && $rows[$r]['b'] == 'C'.$i && $rows[$r]['c'] == 'D'.$j) { $data[$count] = array( 'a' => $rows[$r]['a'], 'b' => $rows[$r]['b'], 'c' => $rows[$r]['c'] ); } } $count++; } }
Output for 4.3.0 - 7.1.0