gettest.php文件:
<BR><?php <BR>$value["name"]= urlencode("我的姓名"); <BR>$value["pass"]= urlencode("pass888"); <BR>$value["age"]=30; <BR>$jsonstr =json_encode($value); <BR>$url="http://127.0.0.1:8080/get.php?id=100&value=$jsonstr"; <BR>$html = file_get_contents($url); <BR>echo $html; <BR>?> <BR>
get.php文件如下:
<BR><?php <BR>$x = json_decode(stripslashes ($_GET["value"]), true); <BR>echo urldecode($x["name"]); <BR>echo urldecode($x["pass"]); <BR>?> <BR>
在IE中输入:http://127.0.0.1:8080/gettest.php
注意:gettest.php,get.php文件的格式utf-(、本文来源gao@!dai!ma.com搞$$代^@码网*搞gaodaima代码8格式。