For example, I have the following code in JSON:
{
"tag": "img",
"attr": [
{
"alt": "text",
"src": "url",
"void": "true",
"all": "true"
}
]
}
What PHP code should I use to echo/print
the code above?
I tried this:
$arr = array (
"tag" => "img",
$attr = array (
"alt" => "text",
"src" => "url",
"void" => "true",
"all" => "true"
)
);
And then:
echo $arr = json_encode($arr);
But I get error. Any ideas?
php5-json
isn't installed – Bojangles Jun 23 at 12:44