There are a couple of much easier ways you can get the equivalent of a contains operator/function:
strpos() // returns position of first match, or FALSE if not found
substr_count() // returns count of matches, which is 0 if not found
for example:
<?php
if (strpos("Hello world!","wo"))
{
echo "Yep, 'Hello world!' contains 'wo'!";
}
else
{
echo "Does not contain.";
}
if (substr_count("Hello world. The world is nice","world") > 0)
{
echo "Found 'world'!";
}
else
{
echo "'world' not found!";
}
?>