Without seeing some code, I'm not sure I understand exactly what you are saying.
One solution that would seem to help, is that you assign all of your HTML output to a variable, $output or whatever, and only output that variable at the end of your script, using concatentation to add on to it throughout the script. If an error occurs in one of the functions, it'll print that, then when you send out your HTML at the bottom of the script, it'll be underneath the already echo'd error. If you'd like all errors to be listed in a certain place, echo all of the HTML code before the corresponding location, assign all remaining HTML to a variable as mentioned above and then echo that at the end. That way, if there were any errors reported, they would effectively be surrounded by your HTML, allowing you to dictate where/how they are displayed.
Another option might be to use error surpressing (turn off display_errors or use the error surpressing symbol '@') and use your own error handling.