Driver Code Let us search 3 in below array
$ arr = array ( 5 , 6 , 7 , 8 , 9 , 10 ) ; $ n = count ( $ arr ) ; $ key = 10 ; echo " Index : ▁ " , ( int ) binarySearch ( $ arr , 0 , $ n -1 , $ key ) ; ? >