fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $ar = array();
  5. $ar[] = 'one';
  6. $ar[] = 'two';
  7. $ar[] = 'three';
  8.  
  9. foreach($ar as $i => $a)
  10. {
  11. print($i . ' -> ' . $a . PHP_EOL);
  12. }
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
0 -> one
1 -> two
2 -> three