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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
finding key values in array [message #184069] Wed, 04 December 2013 00:26 Go to next message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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 16:16 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
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
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: odd iframe problem
Next Topic: well it works!
Goto Forum:
  

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

Current Time: Wed Oct 18 16:33:39 EDT 2017

Total time taken to generate the page: 0.00608 seconds