multidemention array question(s)

From: Date: Fri, 19 Jan 2001 18:46:16 +0000
Subject: multidemention array question(s)
Groups: php.general 
Request: Send a blank email to php-general+get-35686@lists.php.net to get a copy of this message
ok so i set up a multidimensional array with the following code: <?PHP // departments.inc // // This file defines the switches. All the forms, and return displays are // based on this table (multidimential array). The first index is the switch number, // then each department has three proporties. // 1, Can the website use this depatement? // 2, Can this department be used in the admin pages? // 3, Its name. // The idea being when you want to introduce a new department you can turn // it on for admin editing, make sure enough stories, vendors, events, were related, // then open it to the public a few weeks later. $departments = array ("s1" => array("On", "On", "The Seybold Report"), "s2" => array("On", "On", "Publishing Systems"), "s3" => array("On", "On", "Internet Publishing"), "s4" => array("On", "On", "The Bulletin"), "s5" => array("Off", "Off", ""), "s6" => array("Off", "Off", ""), "s7" => array("Off", "Off", ""), "s8" => array("Off", "Off", ""), "s9" => array("On", "On", "Broadband"), "s10" => array("On", "On", "Business"), "s11" => array("On", "On", "Color Management & Proofing"), "s12" => array("On", "On", "Content & Asset Management"), "s13" => array("On", "On", "CTP & On-press Imaging"), "s14" => array("On", "On", "Digital Presses & Variable Data"), "s15" => array("On", "On", "Digital Rights Management"), "s16" => array("On", "On", "E-Books"), "s17" => array("On", "On", "Personalization"), "s18" => array("On", "On", "Print Workflow"), "s19" => array("On", "On", "Standards"), "s20" => array("On", "On", "Wireless"), "s21" => array("Off", "Off", ""), "s22" => array("Off", "Off", ""), "s23" => array("Off", "Off", ""), "s24" => array("Off", "Off", ""), "s25" => array("Off", "Off", ""), "s26" => array("Off", "Off", ""), "s27" => array("Off", "Off", ""), "s28" => array("Off", "Off", ""), "s29" => array("Off", "Off", ""), "s30" => array("Off", "Off", ""), "s31" => array("Off", "Off", ""), "s32" => array("Off", "Off", ""), "s33" => array("Off", "Off", ""), "s34" => array("Off", "Off", ""), "s35" => array("Off", "Off", ""), "s36" => array("Off", "Off", ""), "s37" => array("Off", "Off", ""), "s38" => array("Off", "Off", ""), "s39" => array("Off", "Off", ""), "s40" => array("Off", "Off", "") ); ?> Now I am creating forms and tables and need to retrieve this info I'd like to say something like: if switch s23 is availbe to the admin pages do this, else do that. and echo switch 34's name Little help? Mike

« previous php.general (#35686) next »