note 8311 deleted from array by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Wed, 06 Sep 2000 09:16:53 +0000 |
| Subject: | note 8311 deleted from array by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4226@lists.php.net to get a copy of this message | ||
//example
// Here's an array :
$canadian_provinces = array (
"AB" => "Alberta",
"BC" => "British Columbia",
"MB" => "Manitoba",
);
// We create a function called ulist(); to print ul list
function ulist($canadian_provinces) {
echo "<ul>n";
while (list ($key, $val) = each($canadian_provinces)) {
echo "<li>$key = $valn";
}
echo "</ul>nn";
}
// We use newly create function to print ul list
ulist($canadian_provinces);
// Which prints the following :
<ul>
<li>AB = Alberta
<li>BC = British Columbia
<li>MB = Manitoba
</ul>