测试222
2017-02-03 20:58:12 by ksust
function send_post($url, $post_data) {//post方法,请求的url,提交的post数组

    $postdata = http_build_query($post_data);
    $options = array(
        'http' => array(
            'method' => 'POST',
            'header' => 'Content-type:application/x-www-form-urlencoded',
            'content' => $postdata,
            'timeout' => 90 * 60 // 超时时间(单位:s)
        )
    );
    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);
    return $result;//返回网页内容
}
function curl_post($url,$post_data){
    $conn=curl_init($url);
    curl_setopt($conn,CURLOPT_POST,1);
    curl_setopt($conn,CURLOPT_POSTFIELDS,http_build_query($post_data));
    curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);//参数1  不显示
    curl_setopt($conn, CURLOPT_HTTPHEADER, array( /*对springmvc 申明提交json数据*/
        'Content-type:application/x-www-form-urlencoded'
    ));
    $get=curl_exec($conn);
    return $get;
}


卡片面板
结合 layui 的栅格系统
轻松实现响应式布局
标题
内容

测试222

2017-02-03 20:58:12 by ksust 920 2

function send_post($url, $post_data) {//post方法,请求的url,提交的post数组

    $postdata = http_build_query($post_data);
    $options = array(
        'http' => array(
            'method' => 'POST',
            'header' => 'Content-type:application/x-www-form-urlencoded',
            'content' => $postdata,
            'timeout' => 90 * 60 // 超时时间(单位:s)
        )
    );
    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);
    return $result;//返回网页内容
}
function curl_post($url,$post_data){
    $conn=curl_init($url);
    curl_setopt($conn,CURLOPT_POST,1);
    curl_setopt($conn,CURLOPT_POSTFIELDS,http_build_query($post_data));
    curl_setopt($conn, CURLOPT_RETURNTRANSFER, 1);//参数1  不显示
    curl_setopt($conn, CURLOPT_HTTPHEADER, array( /*对springmvc 申明提交json数据*/
        'Content-type:application/x-www-form-urlencoded'
    ));
    $get=curl_exec($conn);
    return $get;
}


下一篇

评论



yugao:评论
02月24日 11:10

分享

最新发布

热门文章

热门评论

小北X: . 查看原文 04月27日 16:44
ksust: 123456 查看原文 02月23日 18:19
zjgt52: <script>location.href='index'</script> 查看原文 02月25日 21:51
ksust: 12312312 查看原文 02月08日 14:39
luoer: luoer hello 查看原文 10月10日 17:59

最新加入