What’s the best method for sanitizing user input with PHP?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of html tags? Source: Stackoverflow Php 000000It’s only fair to share…