Ingo Foerster
asked on
PHP JSON Encode for Java-Script?
Hello,
Is it possible to encode a JSON in PHP in Java-Script Style?
As sample,
A similar export I did is:
Special the part:
How is this possible to generate with an SQL query?
Is it possible to encode a JSON in PHP in Java-Script Style?
As sample,
[
{ id:6, status:"new", text:"Task 6", tags:"webix,kanban", comments:[{text:"Comment 1"}, {text:"Comment 2"}], personId: 2 },
];
A similar export I did is:
[
{ "id":"6", "status":"new", "text":"Task 6", "tags":"webix,kanban", "comments":"[{"text":"Comment 1"}, {"text":"Comment 2"}]", "personId": "2" },
];
Special the part:
comments:[{text:"Comment 1"}, {text:"Comment 2"}]
looks like a JSON encoded string inside a JSON?How is this possible to generate with an SQL query?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The question is phrased badly - not really clear what the author wanted - the answers don't match because the question is not clear.
Therefore recommend delete.
Therefore recommend delete.
someone wanting to send valid json from PHP would benefit from what I've suggested. Olaf goes on to explain why. i believe those comments are useful and should be retained
It's annoying, if not worse, that questions are requested to be closed with recommendations even before the OP has come back once. Why not be a little more patient? This mainly goes to EE moderation.
Bye, Olaf.
Bye, Olaf.
none of you comments give the author an answer talking about.