Benoit Zohar

You Are Viewing

Category Archives: PHP

Handle json_decode() errors

  • October 18, 2012
  • By
  • In PHP
  • No Comments

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 […]