摘要: 有时候,我们需要在服务器端模拟 POST/GET 等请求,也就是在 PHP 程序中去实现模拟,改怎么做到呢?或者说,在 PHP 程序里,给你一个数组,如何将这个数组 POST/GET 到另外一个地址呢?当然,使用 CURL 很容易办到,那么如果不使用 CURL 库,又该怎么办呢?其实,在 PHP 里 阅读全文
posted @ 2016-06-04 08:35 xx2016 阅读(1011) 评论(0) 推荐(0) 编辑
摘要: UCenter源代码里有一个函数call_user_func,开始以为是自己定义的函数,结果到处都找不到。后来才知道call_user_func是PHP的内置函数,该函数允许用户调用直接写的函数并传入一定的参数,下面总结下这个函数的使用方法。 call_user_func函数类似于一种特别的调用函数 阅读全文
posted @ 2016-06-03 17:58 xx2016 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 Yii rules常用规则 2 3 return [ 4 //必须填写 5 ['email, username, password,agree,verifyPassword,verifyCode', 'required'], 6 7 //检查用户名是否重复 8 ['email','unique','message'=>'用户名已占用'], ... 阅读全文
posted @ 2016-06-03 17:02 xx2016 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 1 $getIp='175.25.25.136'; 2 echo 'IP:',$getIp; 3 echo ''; 4 $content = file_get_contents("http://api.map.baidu.com/location/ip?ak=7IZ6fgGEGohCrRKUE9Rj4TSQ&ip={$getIp}&coor=bd09ll"... 阅读全文
posted @ 2016-06-02 22:08 xx2016 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 1 init(); 31 } 32 33 protected function init() 34 { 35 $this->sRequestMethod = self::GET_REQUEST; 36 $this->sGateUrl = 'http://localhost/cgi'; 37 $this->... 阅读全文
posted @ 2016-06-02 22:03 xx2016 阅读(178) 评论(0) 推荐(0) 编辑
摘要: testCookie name: psw : sub:登录 阅读全文
posted @ 2016-06-02 21:51 xx2016 阅读(1008) 评论(0) 推荐(0) 编辑