Re: [PHP] array_search and multi-dimensional arrays

2006-03-14 Thread List Manager
M. Sokolewicz wrote: List Manager wrote: jonathan wrote: I'd like to return the first key value in the following array such that England would return 1 rather than 3 which is the second key value. Any help would be greatly appreciated. $c[1][]="Vietnam"; $c[1][]="China"; $c[1][]="Thailand

Re: [PHP] array_search and multi-dimensional arrays

2006-03-14 Thread M. Sokolewicz
List Manager wrote: jonathan wrote: I'd like to return the first key value in the following array such that England would return 1 rather than 3 which is the second key value. Any help would be greatly appreciated. $c[1][]="Vietnam"; $c[1][]="China"; $c[1][]="Thailand"; $c[1][]="England";

Re: [PHP] array_search and multi-dimensional arrays

2006-03-14 Thread List Manager
jonathan wrote: I'd like to return the first key value in the following array such that England would return 1 rather than 3 which is the second key value. Any help would be greatly appreciated. $c[1][]="Vietnam"; $c[1][]="China"; $c[1][]="Thailand"; $c[1][]="England"; $c[2][]="USA"; $c[2][]

Re: [PHP] array_search and multi-dimensional arrays

2006-03-13 Thread Philip Thompson
On Mar 13, 2006, at 5:54 PM, jonathan wrote: I'd like to return the first key value in the following array such that England would return 1 rather than 3 which is the second key value. Any help would be greatly appreciated. $c[1][]="Vietnam"; $c[1][]="China"; $c[1][]="Thailand"; $c[1][]="En

Re: [PHP] array_search and multi-dimensional arrays

2006-03-13 Thread jonathan
looks like this works. Is there any problem with it that people can see? $c[1][]="Vietnam"; $c[1][]="China"; $c[1][]="Thailand"; $c[1][]="England"; $c[2][]="USA"; $c[2][]="Japan"; print_r($c); foreach($c as $key=>$value) { if(array_search("England",$value)) { echo $key;