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
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) {
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,
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, ,
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
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)) {
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
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
8 matches
Mail list logo