How do I check if a string contains a specific word?
Asked 07 September, 2021
Viewed 430 times
  • 55
Votes

Consider:

$a = 'How are you?';

if ($a contains 'are')
    echo 'true';

Suppose I have the code above, what is the correct way to write the statement if ($a contains 'are')?

30 Answer