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