$string = array('A','B','C','A','B','C');
For example first instance of C in $string would be 2
Is there a simpler way to do this than doing a complex loop in php?
asked Oct 29, 2009 at 1:37
2 Answers 2
Use array_search()
function. (http://php.net/array_search)
answered Oct 29, 2009 at 1:40
Array_search() will do exactly what you want.
answered Oct 29, 2009 at 1:42
lang-php