Re: [PHP] Array question - Finding the name

2002-06-07 Thread Philip Olson
> I want to find the name of the n-th value in an array. Not the value of > the n-th, but whatever name was given to it. Array_slice seems to just > pull part of an array and put it in another. and key() isn't exactly > what i want either.. Maybe this will help: > $my_array = array('bob' =>

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Jason Wong
On Friday 07 June 2002 23:59, Phil Schwarzmann wrote: > Thanks for your reply! > > I tried using array_slice but I don't think that's exactly that I want > to do. > > I want to find the name of the n-th value in an array. Not the value of > the n-th, but whatever name was given to it. Array_slic

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Phil Schwarzmann
Thanks for your reply! I tried using array_slice but I don't think that's exactly that I want to do. I want to find the name of the n-th value in an array. Not the value of the n-th, but whatever name was given to it. Array_slice seems to just pull part of an array and put it in another. and

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Jason Wong
On Friday 07 June 2002 22:16, Phil Schwarzmann wrote: > Let's say I have an array... > > $my_array[] = array('bob' => $x, 'jim' => $y, 'mike' => $z); you probably meant to define it as: $my_array = array('bob' => $x, 'jim' => $y, 'mike' => $z); use print_r($my_array) to see the difference bet

[PHP] Array question - Finding the name

2002-06-07 Thread Phil Schwarzmann
Let's say I have an array... $my_array[] = array('bob' => $x, 'jim' => $y, 'mike' => $z); Now I want to find the name of the second element in the array (I want my result to be 'jim') How do I do this? I think I might have to use the key() function but I can't quite get it to wkr. Thanks!