/** * Curl版本 * 使用方法: * $post_string = "app=request&version=beta"; * request_by_curl('http://www.80wow.com/api.php',$post_string); */ function request_by_curl($remote_server,$post_string){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$remote_server); curl_setopt($ch,CURLOPT_POSTFIELDS,'mypost='.$post_string); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); curl_setopt($ch,CURLOPT_USERAGENT,"Jimmy's CURL Example beta"); $data = curl_exec($ch); curl_close($ch); return $data; }
Curl版本POST提交
发布于:2013年12月17日已被阅读次
- 热门博文
- 默认方法2(10114)
- 听过PHP吗(3497)
- javascript是最棒的(1078)
- Curl版本POST提交(191)
- MySQL小技巧:让你忘记MySQL密码(180)
- 最新发布
- css默认样式(134)
- linux samba配置(144)
- mysql经典语句(142)
- js 中日期 转换成时间戳 例如2013(155)
- MySQL字段拼接查询(152)