How can the strpos function in PHP be used to address filtering issues in PHP?

When filtering user input in PHP, the strpos function can be used to check if a specific substring exists within the input string. This can help identify and prevent certain malicious or unwanted content from being processed further in the application.

$user_input = $_POST['user_input'];

if (strpos($user_input, 'malicious_content') !== false) {
    // Handle the presence of malicious content
    echo 'Malicious content detected!';
} else {
    // Proceed with processing the user input
    echo 'User input is safe.';
}