If you want to check that a PHP variable contains specific text, then this code could be useful.
Please note: that it is case specific. If you are searching for ‘DOG’ and you have found ‘dog’ it will not trigger successfully.
You will need this script to make the PHP variable to lowercase.
1 2 3 4 5 |
if (strpos($myvar,'are') !== false) { echo 'true'; } |