(preg_match return 1 if there is a match in the string, 0 otherwise).
Example:
PHP
<?php
$data = 'bad';
if (strpos($data, 'bad')!==false or strpos($data, 'naughty')!== false) {
echo "Found";
} else {
echo "Not Found";
}
?>
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 |