Or perhaps a bit confusing, but space/keystroke saving:
PHP Code:
<?php
$my_array = array('index.php">home', 'user.php">member', 'join.php">join', 'login.php">login', 'news.php">news');
$ret = '<a href="' . implode('</a> | <a href="', $my_array) . '</a>';
echo $ret;
?>
If you used the text as keys and the href values as their values, you do foreach on it. If I work that out, I'll add it.
Got it:
PHP Code:
<?php
$my_array = array(
'home' => 'index.php',
'member' => 'user.php',
'join' => 'join.php',
'login' => 'login.php',
'news' => 'news.php'
);
$c = count($my_array);
foreach($my_array as $key => $val){
echo "<a href='$val'>$key</a>";
if(--$c){echo ' | ';}
}
?>
Bookmarks