So I'm trying to make a breadcrumb script in php and I'm getting kinda strange errors.
Here's my script:
function bread_crumb(){
…some code before...
foreach ($words as $key => $value) {
if ($key < count($words) - 1) {
print '<a href ="';
print_link($words,$key);
print '">'.$value.'</a> / ';
}
}
Here's my print_link() script:
function print_link($w,$max){
$_string = "";
for ($i=0; $i < $max; $i++) {
if ($i != $max-1) {
$_string += "/".$w[$i];
} else {
$_string += "/".$w[$i]."/";
}
print $_string;
}
return $_string;
}
It somehow works, but not in a good way. My results are fine between the tags but in the section I get kinda interesting results.
for example this link http://example.com/products/category/
get's translated like this:
<a href ="">Www</a> / <a href ="0">Mondano</a> / <a href ="00">Termékek</a> / <a href ="000">Kategóriák</a> /
I'm really clueles how does a link become "0". Any ideas ?