0
如何在php中回顯json?服務器向我發送json。如何在php中正確寫入? json
$i=$_POST["id"];
if($i==1){
// here i must echo this
{
"item":
{
"html":
[{
"description": "some text",
"n": "1"
}],
"table": {
"1": {
"line": [{
"number": "",
"value": ""
}
]
}
},
"videos": [],
"urlext": [],
"imgs": [ {
"size": {
"root": "xxx xxx"
}
}]
}
}
}
else {
// here i must echo another one
{
"item":
{
"html":
[{
"description": "some text",
"n": "1"
}],
"table": {
"1": {
"line": [{
"number": "",
"value": ""
}
]
}
},
"videos": [],
"urlext": [],
"imgs": [ {
"size": {
"root": "xxx xxx"
}
}]
}
}
}
}
回聲json_encode($ yourContent); – sanj 2013-02-25 14:21:53
[json_encode()](http://php.net/manual/en/function.json-encode.php)。你是怎麼找不到Google的,甚至是搜索這個網站的? – SDC 2013-02-25 14:21:56
SO正在被轟炸,顯示沒有研究的努力的問題,這些天..至少PHP的問題 – Broncha 2013-02-25 14:25:19