2017年1月8日
摘要: 1 'beauty', "upload"=>"@a.zip"); 14 curl_setopt($ch, CURLOPT_POST, 1); 15 curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 16 //**************************************************************************... 阅读全文
posted @ 2017-01-08 16:41 上善若水-随 阅读(988) 评论(0) 推荐(0) 编辑
摘要: 2 php的header来定义一个php页面为utf编码或GBK编码 3 4 php页面为utf编码 5 header("Content-type: text/html; charset=utf-8"); 6 7 php页面为gbk编码 8 header("Content-type: text/html; charset=gb2312"); 9 10 php页面为... 阅读全文
posted @ 2017-01-08 08:12 上善若水-随 阅读(8911) 评论(0) 推荐(0) 编辑
摘要: 1 #php变量与数组相互转换的方法(extract与compact) 2 3 #compact 多个变量转数组 4 $name = 'sui'; 5 $email = 'sui@qq.com'; 6 $arr = compact('name','email'); 7 print_r($arr); 8 9 #extract 数组转多个变量 10 //数组转多个变量 11 $... 阅读全文
posted @ 2017-01-08 08:07 上善若水-随 阅读(4013) 评论(0) 推荐(0) 编辑
摘要: 1 接口开发注意传参问题: 2 3 php中的curl()函数进行post请求的时候,传递数据的格式可以有以下几种方式: 4 5 (1):由参数拼接而成的key=>value键值对字符串。形如以下: name=xxx&age=23$sex=1 6 7 这种请求参数默认是按照application/x-www-form-urlencoded进行编码的。 ... 阅读全文
posted @ 2017-01-08 08:06 上善若水-随 阅读(1669) 评论(0) 推荐(0) 编辑