fork(1) download
  1. <?php
  2.  
  3. function insertionSort(array $array, $value) {
  4. $length=count($array);
  5. for ($i=0;$i<$length;$i++) {
  6.  
  7. if($array[$i] == $value){
  8. echo $i . " " . $value;
  9. }
  10. }
  11.  
  12. }
  13.  
  14. insertionSort([31,
  15. 41,
  16. 59,
  17. 2,
  18. 6,
  19. 41,
  20. 58], 59);
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
2 59