RE: [PHP] Array help
| From: | Pablo Gosse | Date: | Fri, 23 Jul 2004 22:23:56 +0000 |
| Subject: | RE: [PHP] Array help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191701@lists.php.net to get a copy of this message | ||
Robb Kerr wrote:
> On Fri, 23 Jul 2004 14:21:42 -0700 (PDT), Matthew Sims wrote:
>
>> imgBkgrnd = array("1"=> "bkgrnd-default.gif", "2" =>
>> "bkgrnd-positive.gif", "3" => "bkgrnd-negative.gif");
>
> You got it...
>
> imgBkgrnd = array("1"=> "bkgrnd-default.gif", "2" =>
> "bkgrnd-positive.gif", "3" => "bkgrnd-negative.gif");
> imgNeeded =
> table['field']; imgName = ???
>
> Now, how do I get the image name associated with the key number
> obtained from my table out of the array and into the variable so that
> I can use it later in the HTML?
>
> Thanx, Robb
> --
> Robb Kerr
> Digital IGUANA
$imgBkgrnd[i] where 'i' is the number returned from your DB.
HTH.
Pablo