fork(2) download
  1. <?php
  2.  
  3.  
  4. $array = [1, 2, 3, 4, 5, 6, 7, 8, 9];
  5.  
  6. //finds if the value exist and returns key
  7. $key = array_search(8, $array);
  8.  
  9. //return key
  10. echo $key;
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
7