摘要:
1 $arr=array(33,2,54,25,65,34,67,42,87,90,243,213,365,78,67,345,678); 2 sort($arr);//二分查找,一定要在一个有序的里面查找 3 sortAll($arr,54); 4 function sortAll($arr,$key,$low='0',$high='0'){ 5 if($high==0){ 6 $high=count($arr); 7 } 8 $mid=intval(($low+$high)/2); 9 if($arr[$mid]==$key){10 ... 阅读全文
摘要:
1 <?php 2 3 class grabInfo{ 4 public $content; 5 /*Init 初始化 */ 6 public function __construct($url){ 7 $this->ch=curl_init(); 8 curl_setopt($this->ch,CURLOPT_URL,$url); 9 curl_setopt($this->ch, CURLOPT_RETURNTRANSFER,1); 10 curl_setopt($this->ch,CURL_HEA... 阅读全文