php
<?php
$navItems = array(
"首页" => "index.php",
"产品" => "products.php",
"关于我们" => "about.php",
"联系我们" => "contact.php"
);
function generateNav($navItems) {
echo "<ul>";
foreach ($navItems as $label => $url) {
echo "<li><a href=\"$url\">$label</a></li>";
}
echo "</ul>";
}
// 在页面中调用 generateNav() 函数
generateNav($navItems);
?>
顶一下
(0)
0%
踩一下
(0)
0%
- 相关评论
- 我要评论
-