For this, you will need Regular Expressions and the preg_match function. Something like:
Example:
PHP
<?php
$data = 'bad';
if(preg_match('(bad|naughty)', $data) === 1)
{
echo 'Yes';
} else {
echo 'No';
}
?>
If match some word in php | PHP String Tutorial |
PHP Match Specific Word | PHP String Tutorial |
If Match Some Word | PHP String Tutorial |
If Multiple Word Match | PHP String Tutorial |
Type: | Php |
Category: | Web Tutorial |
Sub Category: | PHP String Tutorial |
Uploaded by: | Admin |