$data=json_decode($json,true); if ($data === null && json_last_error() !== JSON_ERROR_NONE) { //error }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter