fork download
  1. <?php
  2. $csv =[
  3.  
  4. ['blah blah blah','he he he'],
  5. ['bleh bleh bleh','ha ha ha'],
  6. ['bloh bloh bloh','ho ho ho'],
  7. ['bluh bluh bluh','hu hu hu'],
  8. ];
  9. //print_r($csv);
  10. $key = [];
  11. $val = [];
  12. for($i=0;$i<count($csv);$i++)
  13. {
  14. array_push($key,$csv[$i][0]);
  15. array_push($val,$csv[$i][1]);
  16. }
  17. //print_r($val);
  18. // print_r($key);
  19.  
  20. for($index=0; $index < count($key);$index++)
  21. {
  22. echo "{$key[$index]} --- {$key[$index+1]}\n";
  23. echo "{$val[$index]} --- {$val[$index+1]}\n";
  24. $index++;
  25. }
Success #stdin #stdout 0.02s 23824KB
stdin
Standard input is empty
stdout
blah blah blah --- bleh bleh bleh
he he he --- ha ha ha
bloh bloh bloh --- bluh bluh bluh
ho ho ho --- hu hu hu