[wd_asp elements=’search’ ratio=’100%’ id=1]

String contains a word – filter – find text pattern

28th October 2013

Php - Strings

php codehaven

$mixedStr = "hello world. This is john duvey";
$searchStr= "john";

if(strpos($mixedStr,$searchStr)) {
echo "Your string here";
}else {
echo "String not here";
}