What function can be used to remove HTML tags from a string in PHP?
When working with strings that contain HTML tags in PHP, you may sometimes need to remove these tags to get only the plain text content. One way to achieve this is by using the `strip_tags()` function in PHP. This function takes a string as input and returns the string with all HTML and PHP tags removed.
// Input string with HTML tags
$htmlString = "<p>This is a <b>sample</b> text with <a href='#'>HTML</a> tags.</p>";
// Remove HTML tags from the string
$plainText = strip_tags($htmlString);
// Output the plain text
echo $plainText;