I am wanting to throw custom errors in many places in some interfaces that I am building. Just using an echo inside my function places that echoed code above the tag in my page. So, I built a custom function to handle errors and give me a backtrace, but again, it prints above the in my page.
Here is the function I am using:
function error($msg) {
trigger_error($msg, E_USER_WARNING);
echo '<pre>';
debug_print_backtrace();
echo '</pre>';
}
How can I get my errors to print inside the tags of my page?
Or, is there a better method to do this?