二分法查找数组元素使用方法如下:
$arr=array(10,20,4,12,69,1,90,56,23,12,89,78);
$obj=new zqf();
$result= $obj->findval($arr,69);二分法快速查找$arr里的元素69,c底层会给数据进行排序
var_dump($result);//结果是Array ( [8] => 69 [result] => Array ( [0] => 1 [1] => 4 [2] => 10 [3] => 12 [4] => 12 [5] => 20 [6] => 23 [7] => 56 [8] => 69 [9] => 78 [10] => 89 [11] => 90 ) )