How can the strpos function be used to check for word combinations in PHP input fields?

When checking for word combinations in PHP input fields, the strpos function can be used to search for a specific word or phrase within the input string. By using strpos, we can determine if the input contains the desired word combination and take appropriate action based on the result. This can be useful for validating input fields or filtering out certain content.

$input = $_POST['input_field']; // Assuming 'input_field' is the name of the input field

if(strpos($input, 'word combination') !== false) {
    // Word combination found in input field
    echo 'Word combination found!';
} else {
    // Word combination not found in input field
    echo 'Word combination not found.';
}