note 107904 deleted from function.json-decode by googleguy
| From: | googleguy@php.net | Date: | Fri, 14 Jun 2013 10:04:18 +0000 |
| Subject: | note 107904 deleted from function.json-decode by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195214@lists.php.net to get a copy of this message | ||
Note Submitter: aeternuslibertas at gmail dot com
----
/*since json_decode() decodes json, it MUST check if the argument passed in is json, so logically
one can assume that json_decode() also functions as a json checker*/
//thus....
if(json_decode($input_json) == NULL)
{
echo("not valid json!");
}else
{
$my_json_object = json_decode($input_json);
}