http://php.net/manual/en/function.strstr.php

$varOne = "is";
$varTwo = "this is a string";
if(strstr($varTwo,$varOne)) {
echo "true.";
} else {
echo "false.";
}

Regards,
@lvin

At 03:58 PM 5/6/01 +0100, Jamie Saunders wrote:
>Hi,
>
>I want to check whether a string contains a certain word e.g.
>
>$varOne = "this is a string";
>
>if ($varOne contains "is") {
>
>         return true;
>
>         } else {
>
>                 return false;
>
>}
>
>Is there an operator for 'contains', if not how do you do this?
>
>Thanks.
>
>
>Jamie Saunders
>Mail: [EMAIL PROTECTED]
>Web: http://jamie-s.co.uk
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to