如何在 php 中回显 json?服务器向我发送 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"
}
}]
}
}
}
}