FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » finding key values in array
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
finding key values in array [message #184069] Wed, 04 December 2013 05:26 Go to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
In my 2d array, I have ten columns with keys.
To determine which set of keys to print out, I have the link set up to
transer the year and the rank.

$find=$array[$year][$rank]

does nothing.

How do I properly go about retrrieving a particular key value?
With only these paramters to work with?
Re: finding key values in array [message #184088 is a reply to message #184069] Wed, 04 December 2013 21:16 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
On Wed, 04 Dec 2013 00:26:34 -0500, richard wrote:

> In my 2d array, I have ten columns with keys.
> To determine which set of keys to print out, I have the link set up to
> transer the year and the rank.
>
> $find=$array[$year][$rank]
>
> does nothing.

It assigns the value in $array[$year][$rank] to the variable $find

However, to do so it does require that $year and $rank fall within the
indices of relevant arrays, ie:

That $year is a valid index in $array, and that $rank is a valid index in
$array[$year]

> How do I properly go about retrrieving a particular key value?
> With only these paramters to work with?

Try dumping $array, $year and $rank, and checking that the above
described requisite conditions are being met.

http://uk3.php.net/manual/en/function.var-dump.php

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: odd iframe problem
Next Topic: well it works!
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Dec 03 18:55:28 GMT 2024

Total time taken to generate the page: 0.02590 seconds