json - PHP Always run function -


I'm trying to get some errors back in JSON format. Therefore, I have created a class level:

  public $ errors = Array ();  

Therefore, can lower various functions returned in the script, and add their error to the $ errors array but, I have to use the refund; In some places to stop the script after an error.

So, when I do this, how can I still run my last error function which will return all the collected errors? How can I get around the issue of script prevention, but still want to return the errors that I need to stop the script ?!

If you are using PHP5 +, then click Destruct The method can be:

  Public function __destruct () {die (var_dump $ this-> Errors)); }  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -