Re: [PHP] strpos with array?

2005-05-13 Thread Marek Kilimajer
Burhan Khalid wrote: Merlin wrote: Burhan Khalid wrote: Merlin wrote: 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

Re: [PHP] strpos with array?

2005-05-12 Thread Burhan Khalid
Merlin wrote: Burhan Khalid wrote: Merlin wrote: 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) {

[PHP] strpos with array?

2005-05-10 Thread Merlin
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,

Re: [PHP] strpos with array?

2005-05-10 Thread Marek Kilimajer
Merlin wrote: 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, ,

RE: [PHP] strpos with array?

2005-05-10 Thread Shaw, Chris - Accenture
Hello, Have you tried using array_keys or array_search for finding an occurrence in an array? HTH. Chris. -Original Message- From: Merlin [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 11:11 To: php-general@lists.php.net Subject: [PHP] strpos with array

Re: [PHP] strpos with array?

2005-05-10 Thread Burhan Khalid
Merlin wrote: 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) { if (in_array($term,$replace)) {

Re: [PHP] strpos with array?

2005-05-10 Thread Merlin
Burhan Khalid wrote: Merlin wrote: 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) { if

Re: [PHP] strpos with array?

2005-05-10 Thread Merlin
Burhan Khalid wrote: Merlin wrote: 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) { if