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'}}
asked Feb 16, 2013 at 18:35
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.

answered Feb 16, 2013 at 18:38

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.