note 66332 deleted from function.str-replace by bjori
| From: | bjori@php.net | Date: | Fri, 19 May 2006 10:27:37 +0000 |
| Subject: | note 66332 deleted from function.str-replace by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-111670@lists.php.net to get a copy of this message | ||
Note Submitter: eetaare at hotmail dot com
Reason: bad code
----
Made a simple function to create a hover effect with css, for the page you are viewing:
<?php
$pageview = "page2";
function menu_hover($page, $menu) {
print $content = str_replace("<li><a name=\"$page\"", "<li
id=\"active\"><a name=\"$page\"", "$menu");
}
$content = "<li><a name=\"page1\" href=\"index.php\">page
1</a></li>
<li><a name=\"page2\" href=\"about.php\">page 2</a></li>
<li><a name=\"page3\" href=\"portfolio.php\">page
3</a></li>";
menu_hover($pageview,$content);
?>