Created
May 8, 2019 08:45
-
-
Save nikolayvitaev/dda29cac68d1df88cc234430a0fef9ec to your computer and use it in GitHub Desktop.
Check is json string on php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isJson($string) { | |
json_decode($string); | |
return (json_last_error() == JSON_ERROR_NONE); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment