Re: More problems...

From: Date: Sat, 18 Nov 2000 17:29:35 +0000
Subject: Re: More problems...
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-26068@lists.php.net to get a copy of this message
(BC == "Brian Clark") brianj@fusionwerks.com writes: BC> (VM == "Ville Mattila") ville.mattila@pilotmedia.net writes: VM>> Hi Brian & others! VM>> This is the code: VM>> --- VM>> while(list($key,$val) = each($prodinfo)) VM>> { VM>> print "$key is $val<br>"; VM>> } VM>> $availc = $prodinfo["Avail"]; VM>> $availdesc = $avail["$availc"]; VM>> print "*** $availc = $availdesc"; VM>> --- VM>> And this is the output: VM>> --- VM>> ID is 15222 VM>> Group is 141 VM>> Name is Sabena A319 & A321 & B737 VM>> Manuf is VM>> Price is 170 VM>> Avail is D VM>> Img is VM>> Desc is VM>> *** D = VM>> --- BC> Then that looks like the problem, no? (I'm asking because I haven't BC> seen your whole app.) BC> Judging by: >> VM> I loaded an array for availability code description like this: >> VM> $avail = array( >> VM> "A1" => "In store", >> VM> "AX" => "Not in store (24 hours)", >> VM> "A" => "Not in store (1-2 days)", >> VM> "B" => "Not in store (1 week)", >> VM> "C" => "Not in store (2 weeks)", >> VM> "D" => "Ei varastossa (3-4 weeks)", >> VM> "X1" => "Not available"); Doh! I misread your message. To me, it looks like something is screwing up during the parsing of the file. Ie. some white-space or something mixed in with the key. If you're reading and exploding the lines, stop it and print it so you can make sure you're extracting exactly what you need. Then go from there. -Brian

« previous php.general (#26068) next »