代码改变世界

(转)PHP模拟POST提交的三种方法

2012-01-12 15:55 by 少毅, 2530 阅读, 1 推荐, 收藏, 编辑
摘要:PHP有三种方法可以模拟POST提交,分别为curl、socket、file_get_contentscurl方式:/*** Curl版本* 使用方法:* $post_string = "app=request&version=beta";* request_by_curl('http://facebook.cn/restServer.php',$post_string);*/function request_by_curl($remote_server,$post_string){ $ch = curl_init(); curl_setopt($c 阅读全文