I have the following code to write on the screen the directory where the user is surfing on my website
<?
$root="http://www.website.com"; //site root
$url = explode("/", $PHP_SELF); //store each path in a variable
static $block; $counter = count($url)-1;
$n=1; //set internal loop counter value to 1 cause $url[0] is empty
echo "<a href='".$root."'>Home</a> > "; link inicial (array $url[0]
while($n<$counter){ $toc =$url[$n]; $block=$block."/".$toc; echo "<a href='".$block."'>".$url[$n]."</a> > ";
$n++;
}
?>
So i want to write for example, instead of "who" wich is the directory the user is acessing by the website "Who we are" i think using a switch this can be done, but this is not working:
<?
$root="http://www.website.com";
$url = explode("/", $PHP_SELF); static $block; $counter = count($url)-1; $n=1; echo "<a href='".$root."'>Home</a> > ";
while($n<$counter){ $toc =$url[$n];
switch($toc){
case $toc="who"; : $toc="Who we are";
break;
}
$block=$block."/".$toc; echo "<a href='".$block."'>".$url[$n]."</a> > ";
$n++;
}
?>