RE: [PHP] strpos with array?
| From: | Shaw, Chris - Accenture | Date: | Tue, 10 May 2005 11:34:48 +0000 |
| Subject: | RE: [PHP] strpos with array? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-214827@lists.php.net to get a copy of this message | ||
Hello,
Have you tried using array_keys or array_search for finding an occurrence in
an array?
HTH.
Chris.
-----Original Message-----
From: Merlin [mailto:news.groups@web.de]
Sent: 10 May 2005 11:11
To: php-general@lists.php.net
Subject: [PHP] strpos with array?
*************************************
This e-mail has been received by the Revenue Internet e-mail service.
*************************************
Hi there,
I am wondering if there is a function (I could not find) which does the same
thing like strpos does, but with an array.
For example:
$replace = array("picture", "pics");
$pos = strpos ($term, $replace);
if ($pos !== false) {
$term = str_replace($replace, "", $term);
echo 'term without the word:'.$term;
}
This does of course not work since strpos does not take arrays.
Thank you for any help,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
************************
This message has been delivered to the Internet by the Revenue Internet e-mail service
*************************