Re: Array help
| From: | Matthew Sims | Date: | Fri, 23 Jul 2004 21:21:42 +0000 |
| Subject: | Re: Array help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191696@lists.php.net to get a copy of this message | ||
> I've got a field in my database that contains a single numerical character
> ("1" or "2" or "3", etc.). I need to load a different background
> image in
> one cell of a table depending upon what the number the field contains.
> What's the easy syntax for associating entries in the field ("1" or
> "2" or
> "3", etc.) with image filenames ("bkgrnd-default.gif" or
> "bkgrnd-positive.gif" or "bkgrnd-negative.gif", etc.)
>
> Thanx,
> Robb
>
You mean like:
imgBkgrnd = array("1"=> "bkgrnd-default.gif", "2" =>
"bkgrnd-positive.gif", "3" => "bkgrnd-negative.gif");
http://us2.php.net/manual/en/function.array.php
--
--Matthew Sims
--<http://killermookie.org>