The small “character” in front of the curly brace is a UTF-8 B(yte) O(rder) M(ark) 0xEF 0xBB 0xBF.I don’t know why this byte sequence is displayed as  here. anstelle des … JSON data is created by nested key-value pairs where the value can be a number, string, Boolean, null, object or array. Looking for answers on Google, I got back to SO: json_decode returns NULL after webservice call. I think this is the actual flaw: The contract of json_decode is too broad. Convert the object into a JSON string. Wait until the request returns with the result (as JSON) Display the result received from the PHP file. Ok, but json_encode('null') return null too. EDIT: Just did some quick inspection of the string provided by the OP. So we have the same return value … Define an object containing a "limit" property and value. Two built-in functions are used in PHP to encode and decode JSON data. Seltsamer Fehler bei json_decode() @peter: Das Komma nach dem letzten Array-Element ist überflüssig, stört aber PHP nicht. Return Values. These are json_encode() and json_decode(). My JSON file had the UTF BOM sequence (some binary chars that … I used the following code to get Null value as Null.

[2008-11-17 15:23 UTC] till@php.net @Iliaa: Could this bug be re-evaluated or a more detailed explaination as of why the docs sometimes note that "NULL" is returned on invalid json, and why sometimes json_decode() returns the string instead?

json_decode is returning a null value instead of an array [on hold] Tag: php , json , curl , error-handling I am trying to search the keyword email in the decoded data.

Take a look at the PHP file: It was in PHP array.

json_decode() returns null if the JSON cannot be decoded or if the encoded data is deeper than the recursion limit. Essentially the system you aquire the data from sends it encoded in UTF-8 with a BOM preceding the data. var_dump() returns Null value as Null but print_r() returns empty. Send a request to the PHP file, with the JSON string as a parameter. PHP array returns empty for Null value . In case of this report, the only last chance for PHP to escape from this madness so far was to document the return value of json_decode as string (without the requirement of it to be valid UTF-8). Returns the value encoded in json in appropriate PHP type. @spooky: ja, ich gebe den Wert korrekt escaped ein und sehe das auch in Testausgaben im save_callback, wenn ich mir z.B. Values true, false and null (case-insensitive) are returned as TRUE, FALSE and NULL respectively.NULL is returned if the json cannot be decoded or if the encoded data is deeper than the recursion limit.