Re: strpos with array?
| From: | Merlin | Date: | Tue, 10 May 2005 12:52:00 +0000 |
| Subject: | Re: strpos with array? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214833@lists.php.net to get a copy of this message | ||
Burhan Khalid wrote:
Merlin wrote:MerlinHi 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) {if (in_array($term,$replace)) {http://www.php.net/in_array Thank you! That was exactly what I was searching for.$term = str_replace($replace, "", $term); echo 'term without the word:'.$term; }