Benoit Zohar

Vous regardez

Archives de Tags: PHP JSON json_decode()

Handle json_decode() errors

  • octobre 18, 2012
  • Par
  • Dans PHP
  • Aucun commentaire

When you use the json_encode() function to parse a JSON file using PHP, do not expect to handle any Exception or to get any information if the parsing failed. In order to handle errors, you will have to call json_last_error() if the result of json_encode() is NULL. NULL means that the data could not be […]