编程语言
首页 > 编程语言> > PHP之post请求

PHP之post请求

作者:互联网

        $url = 'http://www.dnzke.com/pay/gateway/';

        $postdata = http_build_query($params);
        $options = array(
            'http' => array(
                'method' => 'POST',
                'header' => 'Content-type:application/x-www-form-urlencoded',
                'content' => $postdata,
                'timeout' => 15 * 60 // 超时时间(单位:s)
            )
        );

        $context = stream_context_create($options);
        $result = file_get_contents($url, false, $context);

https://www.php.cn/php-weizijiaocheng-395833.html

标签:www,php,http,请求,postdata,context,post,PHP,array
来源: https://blog.csdn.net/qq_33733970/article/details/95972401