RE: [PHP] Array question

From: Date: Wed, 16 Aug 2000 17:08:57 +0000
Subject: RE: [PHP] Array question
Groups: php.general 
Request: Send a blank email to php-general+get-12062@lists.php.net to get a copy of this message
DOH! Don't I feel stupid :) I've always said it's good for someone to check out other's code :) Thanks again! Jay Paulson -----Original Message----- From: Mark Roedel [mailto:roedelm@letu.edu] Sent: Wednesday, August 16, 2000 12:06 PM To: Paulson, Joseph V. "Jay"; php-general Subject: RE: [PHP] Array question > -----Original Message----- > From: Paulson, Joseph V. "Jay" [mailto:jay.paulson@viatel.com] > Sent: Wednesday, August 16, 2000 11:29 AM > To: php-general > Subject: [PHP] Array question > > > I have a quick question about declaring an array. Below is the > code snippet that I am dealing with. What happens when i traverse > the $select["options"] position I only get the last two positions > of the $selectOptions array. Obviously, I need it to traverse all > the positions in the $select["options"] array. I don't have a clue > as to why this is only traversing the last two positions (no matter > how many elements are in the array), but any help would be greatly > appreciated! > > $selectOptions = array("label"=>";lkj", > "value"=>"l;kj;", > "label"=>"canada", > "value"=>"Canada", "label"=>"usa", > "value"=>"USA"); (Or, translated out into a longer form) $selectOptions["label"] = ";lkj"; $selectOptions["value"] = "l;kj"; $selectOptions["label"] = "canada"; $selectOptions["value"] = "Canada"; $selectOptions["label"] = "usa"; $selectOptions["value"] = "USA"; Can you see from this what might be causing your problem? --- Mark Roedel | "Blessed is he who has learned to laugh Systems Programmer | at himself, for he shall never cease LeTourneau University | to be entertained." Longview, Texas, USA | -- John Powell

« previous php.general (#12062) next »