Driver Code
$ arr = array ( 4 , 5 , 6 , 7 , 8 , 9 , 1 , 2 , 3 ) ; $ n = sizeof ( $ arr ) ; $ key = 6 ; $ i = search ( $ arr , 0 , $ n - 1 , $ key ) ; if ( $ i != -1 ) echo " Index : ▁ " , floor ( $ i ) , " ▁ STRNEWLINE " ; else echo " Key ▁ not ▁ found " ; ? >