In this chapter, we investigated issues relating to output in our web applications, including locales, globalization, and formatting numbers and currencies for the end user. We also looked at how we can use output buffering to prevent problems with the header and setcookie functions and even to speed up our applications. Apart from little test snippets of code, we will use output buffering in all of our web applications by including it at the top of each file we generate in script.
With this understanding of how to use PHP to format and control our output, we will turn our attention to validating user input with regular expressions. These are extremely powerful pattern-matching expressions that allow us to do necessary data verification work without having to pick apart strings one character at a time.