/** * file_get_contents 函数 * @param string $url @要访问的URL * @param array $post_data @请求的数据(数组) * @param string $method @请求方式 默认 post * @return bool|string */ function file_contents_post($url = '', $post_data = array(), $method = 'POST') { $sFile = false; if(!empty($post_data) && !empty($url)){ $data = http_build_query($post_data); $opts = array( 'http'=>array( 'method' => $method, 'header' => "Content-type: application/x-www-form-urlencoded\r\n". "Content-length: ".strlen($data)."\r\n" . "Cookie: foo=bar\r\n" . "\r\n", 'content' => $data ) ); $cxContext = stream_context_create($opts); $sFile = file_get_contents($url, false, $cxContext); } return $sFile; }
已抢47756个
抢已抢3192个
抢已抢1178个
抢已抢1281个
抢已抢1019个
抢已抢1717个
抢