Javascript, PHP json will not parse?


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:

 $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'}}



Proper JSON uses double quotes, not single quotes.

People are also looking for solutions to the problem: php - global variables in a loaded page


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.