What potential pitfalls should be considered when using strip_tags() in PHP?

When using strip_tags() in PHP to remove HTML tags from user input, it's important to consider potential pitfalls such as unintentionally removing important content or breaking the structure of the input. To mitigate these risks, it's recommended to use strip_tags() with caution and possibly combine it with other filtering functions to ensure only the desired content is removed.

// Example of using strip_tags() with caution
$user_input = "<p>Hello, <strong>world</strong>!</p>";
$clean_input = strip_tags($user_input, '<p><strong>'); // Only allow <p> and <strong> tags
echo $clean_input;