i POST a JSON-String from an Android Application to a Webserver. There i want to decode the String into JSON and save the data into a database. But here is the Problem.
I read out the POST-Variable:
$json = $_POST['json'];
This brings me:
{"user":"Bob"}
Then i decode the json:
$decoded = json_decode($json, true);
There i get NULL!
BUT, when i create a String in PHP like:
$json = '{"user":"Bob"}';
and decode, it works?! But why? Where is the difference? Hope everyone can help me! :-/
Thanks a lot!
Thomas