I stopped at #3...using stripslashes is not an acceptable deterrent by any means. I am also unsure how htmlentities has anything to do with SQL injection...maybe you meant XSS prevention? I chose not to read the rest.
Many snippets are of questionable quality. Also, any decent programmer should be able to come up with all of them and implement them more cleanly.
Oh, and please people, don't use snippets like those without checking the services first (in the case of the emails, SMS). Just go to the page of the company offering the service, read the documentation AND also read the terms of service.
Jeesh.
stripslashes is used to undo the effects of PHP's old, terrible magic quotes misfeature, b/c the original author (probably not the blog post author) is assuming that $input is coming from the user via GET or POST.
http://www.phptherightway.com/ http://fabien.potencier.org/php-is-much-better-than-you-thin...