Check If A String Is JSON in PHP

1 · Subin Siby · March 8, 2014, 7:21 a.m.
In my previous post, I gave the isHTML function that returns if a string is HTML or not. In this post, I will give you a simple function of different ways that helps in the detection of valid JSON string in PHP. The function I’m giving are fast, easy and doesn’t take up too much CPU memory. Demo Method 1 JSON (JavaScript Object Notation) can be made in to a PHP object using json_decode....