Driver Code
$ arr = array ( " contribute " , " geeks " , " ide " , " practice " ) ; $ x = " ide " ; $ result = binarySearch ( $ arr , $ x ) ; if ( $ result == -1 ) print ( " Element ▁ not ▁ present " ) ; else print ( " Element ▁ found ▁ at ▁ index ▁ " . $ result ) ; ? >