RE: [PHP] string contains X
| From: | Dave VanAuken | Date: | Thu, 14 Dec 2000 18:32:42 +0000 |
| Subject: | RE: [PHP] string contains X | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30333@lists.php.net to get a copy of this message | ||
Number of ways to do this, depends on what you want to do with the output or
the string after the fact... just one is
$numOccur = substr_count($haystack, $needle);
obviously is $numOccur=0 it isn't in there.
many other ways to do this as I said before, check the manual in the String
Functions (ref.strings.html) section and go through them all. bound to be a
usage for you in there.
Dave
-----Original Message-----
From: Peter Benoit [mailto:pbenoit@triton-network.com]
Sent: Thursday, December 14, 2000 1:19 PM
To: php-general@lists.php.net
Subject: [PHP] string contains X
I have a string, and I want to see if it has a specific word in it. How can
I do this in PHP?
Thanks,
Pete
--
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