1

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'}}
2
  • 4
    Proper JSON uses double quotes, not single quotes. Commented Feb 16, 2013 at 18:37
  • How are you creating that string? Various JS libraries will do the encoding to JSON for you. Commented Feb 16, 2013 at 18:47

1 Answer 1

3

Proper JSON uses double quotes, not single quotes.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.