asked on
"data" : [
{
"data" : "My Documents",
"children" : [ {"attr":{"id":"2","rel":"file"},"data":"file1.doc","state":""} ]
}
]
ASKER
$obj = array(
array(
"data" => "My Documents",
"children" => array(
array(
"attr" => array(
"id" => 2,
"rel" => "file"
),
"data" => "file1.doc",
"state" => ""
)
)
)
);
echo json_encode($obj);
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
http://us3.php.net/manual/en/function.json-encode.php
Refer to the example sections on that page