Re: if string contains...
| From: | Gyozo Papp | Date: | Sun, 06 May 2001 15:17:38 +0000 |
| Subject: | Re: if string contains... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51622@lists.php.net to get a copy of this message | ||
$pos = strpos($varone, 'is')
if ($pos === false) { /*not found */ }
----- Original Message -----
From: "Jamie Saunders" <webprogramming@jamie-s.co.uk>
To: <php-general@lists.php.net>
Sent: 2001. május 6. 16:58
Subject: [PHP] if string contains...
> 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: webprogramming@jamie-s.co.uk
> Web: http://jamie-s.co.uk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>