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

Home » Imported messages » comp.lang.php » Need help accessing the key array.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Need help accessing the key array. [message #185490 is a reply to message #185473] Fri, 04 April 2014 02:13 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Wed, 02 Apr 2014 09:57:15 -0700, Kevin Burton wrote:

> That is what I meant when I said what if you cannot change the input.
> You replied, "what input?". The input was the array that was specified
> in the original question.

No, the array that was specified in the original question was not input,
although it could be described as data held within the program that.

Input is information that is provided to the program at run time. Not
data that is part of the program.

In the problem as originally posted, all the data was contained within
the program code. There was no separate input data.

The answer to the first question the OP asked (How to access the $rates
array to echo the associated rate of "animal" => 1 and "color" => 2 ?) is:

$rates[3*$input_animal+$input_color]["rate"]

The answer to the second question the OP asked (should i re-designed the
$rates array) is:

Yes, there are much better ways to design your data array.

The answer to "Does Kevin Burton respect usenet etiquette" is clearly:

No, he can't be bothered to respect nearly 35 years of usenet etiquette.

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Most secure way to reset a password via email link
Next Topic: Strange but true! Working with interfaces in PHP
Goto Forum:
  

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

Current Time: Sun Nov 24 21:22:32 GMT 2024

Total time taken to generate the page: 0.04481 seconds