note 125503 deleted from function.json-decode by cmb
| From: | cmb@php.net | Date: | Tue, 10 Nov 2020 11:10:39 +0000 |
| Subject: | note 125503 deleted from function.json-decode by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215834@lists.php.net to get a copy of this message | ||
Note Submitter: Cristiano
----
Any only-digit string will pass the check of the function, and json_last_error() won't report
anything.
To check if it's a valid json, it is mandatory to use: if (is_numeric($string)) return false;
https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php/6041773#6041773