What is the recommended PHP function for removing all HTML tags from a string?

When working with user-generated content, it is often necessary to remove any HTML tags to prevent potential security vulnerabilities or unwanted formatting in the output. The recommended PHP function for removing all HTML tags from a string is `strip_tags()`. This function takes a string as input and returns the string with all HTML and PHP tags stripped out.

// Input string with HTML tags
$input = "<p>This is a <b>sample</b> text with <a href='#'>HTML</a> tags.</p>";

// Remove all HTML tags from the input string
$output = strip_tags($input);

// Output the sanitized string
echo $output;