zabmilenko's approach is not what I'd recommend either- as it will cause $GET and $POST to become escaped with htmlspecialchars, even if they are not going to be output to the browser.
This will cause data corruption, as your database, emails, etc, will fill up with & and < and such like.
Moreover, if you're taking the contents of a form and posting it back into itself (for example, if validation fails), HTML special characters will "breed" causing &amp;amp;amp;lt; and other dodgy stuff to appear all over the place.
It's just going to cause trouble.
This is basically the same problem as using magic_quotes- it will cause things to be escaped in the wrong place.
Mark