note 19051 deleted from function.array-keys by philip
| From: | philip@php.net | Date: | Sun, 14 Jul 2002 01:35:39 +0000 |
| Subject: | note 19051 deleted from function.array-keys by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33041@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";
}