Crazy knowledge base

利用Curl、socket、file_get_contents POST数据

array( 
            'method'=>'POST', 
            'header'=>'Content-type: application/x-www-form-urlencoded'."rn". 
                      'User-Agent : Jimmy's POST Example beta'."rn". 
                      'Content-length: '.strlen($post_string)+8, 
            'content'=>'mypost='.$post_string) 
        ); 
    $stream_context = stream_context_create($context); 
    $data = file_get_contents($remote_server,FALSE,$stream_context); 
    return $data; 
}

?> 


利用Curl、socket、file_get_contents POST数据

3条评论在“利用Curl、socket、file_get_contents POST数据

  1. Great! Thank you!
    I always wanted to write in my site something like that. Can I take part of your post to my site?
    Of course, I will add backlink?

    Sincerely, Your Reader

评论已关闭。

滚动到顶部