gettest.php file:
Copy code The code is as follows:
$value["name"]= urlencode("my name");
$value["pass"]= urlencode("pass888");
$value["age"]=30;
$jsonstr =json_encode($value);
$url="http://127.0.0.1:8080/get.php?id=100&value=$jsonstr";
$html = file_get_contents($url) ;
echo $html;
?>
get.php file is as follows:
Copy code The code is as follows:
$x = json_decode(stripslashes ($_GET["value"]), true);
echo urldecode($ x["name"]);
echo urldecode($x["pass"]);
?>
Enter in IE: http://127.0.0.1 :8080/gettest.php
Note: gettest.php, get.php file format is utf-8 format.
http://www.bkjia.com/PHPjc/327538.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327538.htmlTechArticlegettest.php file: Copy the code as follows: ?php $value["name"]= urlencode("I name"); $value["pass"]= urlencode("pass888"); $value["age"]=30; $jsonstr =json_encode($value...