How can I use a regular expression to match a pattern in a string in PHP? Example code: - Biz Tech

How can I use a regular expression to match a pattern in a string in PHP? Example code:

Listen
$string = "The quick brown fox jumps over the lazy dog";

if (preg_match("/brown/", $string)) {
    echo "The string contains 'brown'";
} else {
    echo "The string does not contain 'brown'";
}