<?php
$path = $_SERVER["PHP_SELF"];
$parts = explode('/',$path);
if (count($parts) < 2)
{
echo("home");
}
else
{
echo ("<a href=\"/\">home</a> » ");
for ($i = 1; $i < count($parts); $i++)
{
if (!strstr($parts[$i],"."))
{
echo("<a href=\"");
for ($j = 0; $j <= $i; $j++) {echo $parts[$j]."/";};
echo("\">". str_replace('-', ' ', $parts[$i])."</a> » ");
}
else
{
$str = $parts[$i];
$pos = strrpos($str,".");
$parts[$i] = substr($str, 0, $pos);
echo str_replace('-', ' ', $parts[$i]);
};
};
};
?>
http://www.websitecodetutorials.com/code/php/how-to-breadcrumb-navigation.php
ให้คร่อม div ใน code
<div class="breadcrumb_icon">
...
</div>
ไฟล์ css
.breadcrumb_icon a{
background: rgba(0, 0, 0, 0) url("http://cymiz.com/images/icon_alert.png") no-repeat scroll 0 0;
color: #fff;
display: block;
float: left;
font-family: Arial;
font-size: 12px;
font-weight: bold;
height: 13px;
margin-left: 5px;
padding: 5px 8px;
width: 48px;
}
ให้คร่อม div ใน code
โค๊ด: [Select]
<div class=”bc”>
…
</div>
ไฟล์ css
.bc a {
padding: 3px 10px 3px 10px;
background-color: #0F7AC3;
font-size: 11px;
font-weight: normal;
line-height: 21px;
text-decoration: none;
color: #FFFFFF;
text-shadow: 1px 1px 0px #336600;
margin-left: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
}
.bc a:hover {
padding: 3px 10px 3px 10px;
background-color: #FF6600;
font-size: 11px;
font-weight: normal;
line-height: 21px;
text-decoration: none;
color: #FFFFFF;
text-shadow: 1px 1px 0px #336600;
}