1 $arr[$mid]){46 $low = $mid+1;47 }48 $mid = floor(($low+$high)/2);49 }50 return $val==$arr[$mid]?$mid:-1;51 }52 53 $arr = array(9,6,10,2,5,3,1,8);54 echo seq_search($arr,8,2);55 echo '';56 echo binary_search_recursive($arr,0,7,2);57 echo '';58 echo binary_search($arr,0,7,2);59