SyntaxFix
Write A Post
Hire A Developer
Questions
I found this question after coming across something similar in my work, yesterday. My solution in the end was a hybrid of some of the approaches above:
function is_JSON($string) { return (is_null(json_decode($string, TRUE))) ? FALSE : TRUE; }