<?php
function breadcrumbs($home = 'Ana Sayfa') {
//Use RDFa breadcrumb, can also be used for microformats etc.
$bc = '';
$isaret = ' »';
//Get the website:
$site = 'http://'.$_SERVER['HTTP_HOST'];
//Get all vars en skip the empty ones
$crumbs = array_filter( explode("/",$_SERVER["REQUEST_URI"]) );
//Create the home breadcrumb
$bc .= '<li><a href="'.$site.'" rel="v:url" property="v:title">'.$home.''.$isaret.'</a></li>';
//Count all not empty breadcrumbs
$nm = count($crumbs);
$i = 1;
//Loop the crumbs
foreach($crumbs as $crumb){
$link = ucfirst( str_replace( array(".php","-","_"), array(""," "," ") ,$crumb) );
$site .= '/'.$crumb;
//Make the next crumb
$bc .= '<li><a href="'.$site.'" rel="v:url" property="v:title">'.$link.''.$isaret.'</a></li>';
$i++;
}
$bc .= '';
//Return the result
return $bc;}
?>
Hello There
I am using in my web sites this great Php dynamic bredcrump solution which was an answer in this post. Thank you for sharing. But i have a question;
In my site i am using Turkish language, and Turkish language has 7 non-english letter in it's alphaphet.so when the script copy the adress bar breadcrump shows only english compatible letters unfortunattely not turkish letters.
Question is : With this script is it possible the create a variable that allows to tweak and show created link's title in breadcrump menu
For example :
Adress Bar=
http://www.mamaia.com/tr/urunler/cocuk-uretimi-alcilar
Breadcrump = (should be)
Ana Sayfa > Tr > Ürünler > Çocuk Üretimi Alçılar
is there any suggestions?