In fact, also relatively simple, on the code:
Copy CodeThe code is as follows:
$url = ' http://127.0.0.1/test.php ';//post points to the link
$data = Array (
' Access_token ' = ' thekeyvalue '
);
$json _data = PostData ($url, $data);
$array = Json_decode ($json _data,true);
Echo '
';p rint_r ($array);
function PostData ($url, $data)
{
$ch = Curl_init ();
$timeout = 300;
curl_setopt ($ch, Curlopt_url, $url);
curl_setopt ($ch, Curlopt_referer, "http://www.jb51.net/"); Construction route
curl_setopt ($ch, Curlopt_post, true);
curl_setopt ($ch, Curlopt_postfields, $data);
curl_setopt ($ch, Curlopt_returntransfer, 1);
curl_setopt ($ch, Curlopt_connecttimeout, $timeout);
$handles = curl_exec ($ch);
Curl_close ($ch);
return $handles;
}
?>
http://www.bkjia.com/PHPjc/326623.html www.bkjia.com true http://www.bkjia.com/PHPjc/326623.html techarticle In fact, it is also relatively simple, on the code: Copy the Code as follows: PHP $url = ' http://127.0.0.1/test.php ';//post points to the link $data = Array (' Access_token ' = ' Thekeyvalue '); $jso ...