RE: strpos with array?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx]
Sent: 10 May 2005 11:11
To: php-general@xxxxxxxxxxxxx
Subject:  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

*************************

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux