note 19051 added to function.array-keys

From: Date: Thu, 14 Feb 2002 01:11:16 +0000
Subject: note 19051 added to function.array-keys
Groups: php.notes 
Request: Send a blank email to php-notes+get-26597@lists.php.net to get a copy of this message
If you have many values for each key, here's an example of how to do it: $SECTIONS = array("global" => array("interval", "device", "udp port", "host allowed"), "image" => array("norm", "width", "height"), "image text" => array("disable", "x", "y", "text"), "channel 1" => array("disable"), "channel 2" => array("disable"), "channel 3" => array("disable"), "channel 4" => array("disable")); foreach(array_keys($SECTIONS) as $s) { print "<b>section: $s</b><br>\n"; for($i = 0; $SECTIONS[$s][$i]; $i++) print "value: " . $SECTIONS[$s][$i] ."<br>\n"; } -- http://www.php.net/manual/en/function.array-keys.php http://master.php.net/manage/user-notes.php?action=edit+19051 http://master.php.net/manage/user-notes.php?action=delete+19051 http://master.php.net/manage/user-notes.php?action=reject+19051

« previous php.notes (#26597) next »