Method 1
Copy CodeThe code is as follows:
$ch = Curl_init ();
curl_setopt ($ch, Curlopt_url, "http://192.168.1.135/turntable/get_jump.php");
curl_setopt ($ch, Curlopt_header, 0);
curl_setopt ($ch, Curlopt_postfields, $array);
Curl_exec ($ch);
Curl_close ($ch);
Method 2
Copy CodeThe code is as follows:
$data [' uid '] = $this->uid;
$data [' efforts '] = $res [' efforts '];
$data [' breakthrough '] = $res [' breakthrough '];
$data [' target '] = $res [' Target '];
$str = ";
foreach ($data as $k = = $v) {
if (Is_array ($v)) {
foreach ($v as $kv = = $VV) {
$str. = ' & '. $k. ' ['. $kv. ']=' . UrlEncode ($VV);
}
} else {
$str. = ' & '. $k. '=' . UrlEncode ($v);
}
}
$context =
Array (' http ' = =
Array (' method ' = ' POST ',
' Header ' = ' content-type:application/x-www-form-urlencoded '. \ r \ n ".
' User-agent:manyou API PHP Client 0.1 (Non-curl) '. Phpversion (). " \ r \ n ".
' Content-length: '. Strlen ($STR),
' Content ' = $str));
$contextid = Stream_context_create ($context);
$sock = fopen (' http://192.168.1.135/turntable/get_jump.php ', ' R ', false, $contextid);
if ($sock) {
$result = ";
while (!feof ($sock)) {
$result. = Fgets ($sock, 4096);
}
Fclose ($sock);
http://www.bkjia.com/PHPjc/324233.html www.bkjia.com true http://www.bkjia.com/PHPjc/324233.html techarticle Method 1 Copy the code code as follows: $ch = Curl_init (); curl_setopt ($ch, Curlopt_url, "http://192.168.1.135/turntable/get_jump.php"); curl_setopt ($ch, Curlopt_header, 0); curl_setopt ( ...