fork(2) download
  1. <?php
  2.  
  3. $associative_array1 = array (
  4. 'Objective' => array ( 0 => 'Conversions', 1 => 'Lead Generation', ),
  5. 'Gender' => array ( 0 => 'Male (17.99% cheaper )', 1 => 'Male (6.46% cheaper ) Male (16% cheaper )', ),
  6. 'Age' => array ( 0 => '45-54 (17.99% cheaper )', 1 => '45-54 (6.46% cheaper )35-44 (16% cheaper )', ),
  7. 'Placement' => array ( 0 => 'Mobile Feed (30.8% cheaper) right_hand (46.81% cheaper)', 1 => 'Mobile Feed (12.56% cheaper)', ),
  8. 'Device' => array ( 0 => 'Android (30.8% cheaper) Desktop (46.81% cheaper)', 1 => 'iPhone (12.56% cheaper)', ),
  9. );
  10.  
  11. $keys = array_keys($associative_array1);
  12. $count = count($associative_array1[$keys[0]]);
  13. for ($i = 0; $i < $count; $i++) {
  14. echo "<tr>";
  15. foreach ($keys as $key) {
  16. echo "<td>" . nl2br($associative_array1[$key][$i]) . "</td>";
  17. }
  18. echo "</tr>\n";
  19. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
<tr><td>Conversions</td><td>Male (17.99% cheaper )</td><td>45-54 (17.99% cheaper )</td><td>Mobile Feed (30.8% cheaper) right_hand (46.81% cheaper)</td><td>Android (30.8% cheaper) Desktop (46.81% cheaper)</td></tr>
<tr><td>Lead Generation</td><td>Male (6.46% cheaper )  Male (16% cheaper )</td><td>45-54 (6.46% cheaper )35-44 (16% cheaper )</td><td>Mobile Feed (12.56% cheaper)</td><td>iPhone (12.56% cheaper)</td></tr>