I am sending this to PHP:
{'command' : 'move', 'data' : { 'seat_id' : '"+seat+"'}}
But cannot parse it though PHP. The correct data i got from PHP is:
{'command' : 'move', 'data' : { 'seat_id' : '44'}}
I have tried following:
<?php
$in = $Server->output(); //this is the json text
$o = json_decode($in); //has also tried put "TRUE" in the function.
print_r($o); ?>
It just output
{'command' : 'move', 'data' : { 'seat_id' : '44'}}
asked Feb 16, 2013 at 18:35
-
4Proper JSON uses double quotes, not single quotes.Amber– Amber2013年02月16日 18:37:15 +00:00Commented Feb 16, 2013 at 18:37
-
How are you creating that string? Various JS libraries will do the encoding to JSON for you.halfer– halfer2013年02月16日 18:47:13 +00:00Commented Feb 16, 2013 at 18:47
1 Answer 1
Proper JSON uses double quotes, not single quotes.
answered Feb 16, 2013 at 18:38
Comments
default