I have an array which is defined by names, for instance $name['Fred']='Fred Michael Johnson'; . However, if I want to pass an array element from one page to another, I use the GET method so I would have http://www.mypage.com/index.php?arrayid=1. What I would like to know is, how I can get the array element number of $name['Fred']. Any help?
If you're using a string indexed array, why not just pass
http://www.mypage.com/index.php?arrayid=Fred
?
-- Rich Rijnders -- Irvine, CA US
Indeed. Or, to be my usual pessemistic self, there is no element number when the array index is a string. :-) 'Fred' is the only way you can directly access the element (as opposed to traversing the entire array looking for it.)