function isJson($string) {
json_decode($string);
return json_last_error() === JSON_ERROR_NONE;
}
More Related Contents:
- How to create this type of JSON data from PHP [closed]
- How to extract and access data from JSON with PHP?
- How to convert JSON string to array
- How to get the jQuery $.ajax error response text?
- json_encode PHP array as JSON array not JSON object
- REST API – why use PUT DELETE POST GET?
- Why is json_encode adding backslashes?
- The holy grail of cleaning input and output in php?
- php get values from json encode
- json_decode returns JSON_ERROR_SYNTAX but online formatter says the JSON is OK
- How to update/edit a JSON file using PHP [closed]
- How can I get PHP to produce a backtrace upon errors?
- Disable Laravel’s built-in error handling methods
- Handling big user IDs returned by FQL in PHP
- org.json.JSONException: Value
- Parse JSON string contents into PHP Array
- Invalid JSON parsing using PHP
- PHP convert XML to JSON group when there is one child
- How to build a JSON array from mysql database
- Outputting all PHP errors to database not error_log
- Handling data in a PHP JSON Object
- Get value from JSON array in PHP
- json parse error with double quotes
- How to remove backslash on json_encode() function?
- How do I loop through JSON array
- How to iterate through a nested stdClass? [duplicate]
- PHP: Most frequent value in array
- Json: PHP to JavaScript safe or not?
- Why are escape characters being added to the value of the hidden input
- Read JSON Data Using PHP [duplicate]