I have an array with a list of values. Not an associative array, just a plain one. I need to know where in the array is a specific value, and I don\'t know how to find out 🙁
like, i have the word \'foo\' in an array. \'foo\' is $array[?].
if you have php4, look at array_search in the manual
if you have php3, do { if(current($array)=="foo") $loc_st=key($array); } while(next($array));
be carefull with the do..while, it assumes that $array contains at least one element.
I was doing it with a for(;😉, thanks for the array_search, shaved a few lines off 😉
what about array_search() ?