Catch all PHP errors and put them in a string var
<p>How can I catch all PHP errors and put them in a string var?</p>

<p>I suppose I should use set_error_handler().</p>

<p>I am using Ajax + JSON and would like to output the errors in a string and then output them through JSON. </p>

<p>Thank you.</p>
