function httpPost($url,$post=array(),$cookies=array()) { $optsCookies=''; foreach($cookies as $key => $val) {$optsCookies.="Cookie: {$key}={$val}\r\n";} $opts = array( 'http'=>array( 'method' => 'POST' ,'header'=>"Accept-language: en\r\n" ."Content-type: application/x-www-form-urlencoded\r\n" .$optsCookies ,'content'=>http_build_query($post) ) ); $context = stream_context_create($opts); return file_get_contents($url, false, $context); }