How to Make Menu using php Array

0 comments

<?php

$menu = array(
"HOME" => "http://hackresource.blogspot.com",
"Google" => "http://www.google.com",
"PHP" => "http://hackresource.blogspot.com/search/label/PHP"
);

?>
<html>
<head>
<title>teste</title>
</head>
<body>
<a href="<?php echo $menu['HOME']; ?>" target="_blank">Home</a> <br>
<a href="<?php echo $menu['Google']; ?>" target="_blank"> Google </a><br>
<a href="<?php echo $menu['PHP']; ?>" target="_blank"> PHP </a>
</body>
</html>

target is attribute of anchor tag   specifies where to open the linked document values are:
_blank               Opens the linked document in a new window or tab
_self                  Opens the linked document in the same frame as it was clicked (this is default)
_parent             Opens the linked document in the parent frame
_top                  Opens the linked document in the full body of the window

Copyright © Blog Templates