Which PHP function checks if a string is a valid JSON string?

  • json_verify()
  • json_decode()
  • json_check()
  • json_is_valid()
To check if a string is a valid JSON string in PHP, you can use the json_is_valid() function. This function returns true if the string is valid JSON and false if it's not. Using json_decode() will attempt to decode the string and return null on invalid input.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *