Code: Select all
$a = 'how are you';
if (strpos($a,'are')) {
echo 'true';
}
$a has dynamic content going into it. I want to check if that dynamic content contains a word.
So $a could "black t-shirt".
I want to check is "shirt" is in that string.
Therefore, am trying this but it's coming back with nothing:
Code: Select all
if (strpos($a,'shirt')) {
echo 'true';
}