$pages = array('index.html' => 'Home', 'search.html' => 'Search');
function menu($pages) {
foreach ($pages as $page => $desc) {
if (stristr($_SERVER['SCRIPT_FILENAME']), $page) {
echo '<p><a class="nav" href="index.html"</a><b>' .
$desc . '</b></p>';
} else {
echo '<p><a class="nav" href="index.html"</a>' . $desc . '</p>';
}
}
<p><a class="nav" href="index.html"><?php
if(stristr($_SERVER["SCRIPT_FILENAME"],"index.html"))
{
echo "<b>Home</b>";
}else{
echo "Home";
}
?></a>
<p><a class="nav" href="index.html"><?php
if(stristr($_SERVER["SCRIPT_FILENAME"],"search.html"))
{
echo "<b>Search</b>";
}else{
echo "Search";
}
?></a>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php