finding key values in array [message #184069] |
Wed, 04 December 2013 05:26 |
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 |
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
|
|
|