01-18-2008, 05:50 PM
|
#6 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
json_encode will never return a boolean. If you previously check that the $szContent cannot be FALSE then you might consider it ok to check to see if json_encode returns string "false".
However, if you pass in a non-encodable value (e.g. a resource) the return string won't be "false" but will instead be (string) "null" with an E_WARNING error ([json] (json_encode_r) type is unsupported, encoded as null.).
Depending on your specific scenario, simply checking for string "false" might suffice.
|
|
|
|