More problems...
| From: | Ville Mattila | Date: | Sat, 18 Nov 2000 16:32:24 +0000 |
| Subject: | More problems... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26059@lists.php.net to get a copy of this message | ||
Hi again,
And more problems... This time there is something mysterious with arrays.
I loaded an array for availability code description like this:
$avail = array(
"A1" => "In store",
"AX" => "Not in store (24 hours)",
"A" => "Not in store (1-2 days)",
"B" => "Not in store (1 week)",
"C" => "Not in store (2 weeks)",
"D" => "Ei varastossa (3-4 weeks)",
"X1" => "Not available");
Then I read product data from a file and save it as $prodinfo["Name"],
$prodinfo["Avail"] ....
Now trying to get description for the code like following, but nothing will be printed out.
echo $avail[$prodinfo["Avail"]];
I tried this kind of code also:
$availc = $prodinfo["Avail"];
echo $availc; // (this works)
$availdesc = $avail[$availc];
echo $availdesc; // (but this doesn't)
$availdesc = $avail["A"];
echo $availdesc; // (this works fine)
So, what's the matter now? ;)
.............................................
Ville Mattila
Ikaalinen, Finland