Horje

If Match Some Word

For this, you will need Regular Expressions and the preg_match function. Something like:

index.php
Example: PHP
<?php
$data = 'bad';
if(preg_match('(bad|naughty)', $data) === 1) 
{
echo 'Yes';    
} else {
echo 'No';    
}
?>

Output should be:

If Match Some Word



Single Articles
If match some word in phpPHP String Tutorial
PHP Match Specific WordPHP String Tutorial
If Match Some WordPHP String Tutorial
If Multiple Word MatchPHP String Tutorial


Related Articles
How to check if a string contain multiple specific words PHP String Tutorial
How to extract words from Sentence in PHP PHP String Tutorial
How to check if string is_numeric() Function in PHP PHP String Tutorial
How to get only text from HTML Source Code by PHP PHP String Tutorial
How to get first 3 words from a sentence by PHP PHP String Tutorial
How to work if empty value does not else PHP String Tutorial
How to remove first Five Line from a TXT File in PHP PHP String Tutorial
How to get Longest Word from a Sentence in PHP PHP String Tutorial
How to remove first character from string php PHP String Tutorial
How to count if Number is below than 10 sum PHP String Tutorial
How to get back page link PHP String Tutorial
How to get first 3 longest words from a sentence PHP PHP String Tutorial
How to count number of words from sentence in PHP PHP String Tutorial
How to remove all number from a string php PHP String Tutorial

Type:
Php
Category:
Web Tutorial
Sub Category:
PHP String Tutorial
Uploaded by:
Admin



Share on: