Re: [PHP] two dimensional array or two arrays?

2001-08-28 Thread Philip Olson
Your $categoryarry is a 2d array, try : print_r($categoryarry); But, I think you want to do : $categories = array('Sasheen','Tom','Fred'); Now, if you do this : while(list($key,$value) = each($categories)) { print "$key : $value\n"; } You'll get : 0 : Sasheen 1 : Tom 2

Re: [PHP] two dimensional array or two arrays?

2001-08-28 Thread Anton Stroganov
option .= "$value[1]\n"; } } - Original Message - From: Tom Beidler <[EMAIL PROTECTED]> To: php list <[EMAIL PROTECTED]> Sent: Tuesday, August 28, 2001 12:23 Subject: [PHP] two dimensional array or two arrays? > I have some code I use to create pulldown menus

[PHP] two dimensional array or two arrays?

2001-08-28 Thread Tom Beidler
I have some code I use to create pulldown menus. It's as follows; $categoryarry = array("","1","2","3","4","5"); while (list($key,$value) = each($categoryarry)) { if ($value == $srch_cat) { $cat_option .= "$value\n"; } else { $cat_option .= "$value\n"; } } It works fine when the pu