Forum Moderators: coopster

Message Too Old, No Replies

Find first occurrence of a string from an array in a string

Like strpos()

         

Jacob or JaF

2:36 am on Dec 14, 2007 (gmt 0)

10+ Year Member



Hi all,

I can't seem to find a solution for this.


$array=array('1', '2', '3');
$string='76543210';
strpos($string, $array);

Is there such a thing as a strpos() like function that accepts arrays in the "search for" field?

I hope I'm clear enough, it's kind of hard to explain.

Thanks a lot,
Jacob

eelixduppy

3:20 am on Dec 14, 2007 (gmt 0)



Check array_search [us2.php.net] :)