摘要: 1、常见的设置选项 CURLOPT_USERAGENT —— 设置user_agent 2、常见的http_code错误 301:Moved Permanently —— CURLOPT_FOLLOWLOCATION => true (301跟随) 3、常见的curl_errno错误 60:CURL 阅读全文
posted @ 2017-12-11 16:23 jiazuanjie 阅读(2221) 评论(0) 推荐(0)
摘要: 下面是方法,采用递归的方式实现: 然后,我们就可以直接调用这个方法,通过改变第二个参数获取父类的所有子类 结果如下(json形式) 1 [ 2 { 3 "id": 1, 4 "parent_id": 0, 5 "cate_name": "一级", 6 "son": [ 7 { 8 "id": 3, 阅读全文
posted @ 2017-12-05 15:18 jiazuanjie 阅读(309) 评论(0) 推荐(0)
摘要: 1、冒泡排序 1 /** 2 * 冒泡排序 3 * @param $array 4 * @return string 5 */ 6 function bubble_sort($array) 7 { 8 if (empty($array)) { 9 return 'empty'; 10 } 11 $l 阅读全文
posted @ 2017-12-04 09:27 jiazuanjie 阅读(133) 评论(0) 推荐(0)