Reputation: 2455
$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?
Upvotes: 0
Views: 2097
Reputation: 680
Array_search() will do exactly what you want.
http://us.php.net/manual/en/function.array-search.php
Upvotes: 1