parse error, unexpected T_Variable
Posted: Fri Apr 15, 2005 1:01 pm
I get an error on line 9 of the below code (the line beginning with $str)
'parse error, unexpected T_Variable'.
I'm pretty new to PHP programming and not sure what's wrong with that line...any suggestions?
'parse error, unexpected T_Variable'.
I'm pretty new to PHP programming and not sure what's wrong with that line...any suggestions?
Code: Select all
<?php
function breadcrumb_nav($basename = "Home") {
global $PHP_SELF, $bc_site, $bc_label;
$site = $bc_site;
$return_str = "<A HREF=/"//">$basename</A>";
$str = substr(dirname($PHP_SELF), 1);
$arr = split('/', $str);
$num = count($arr);
if ($num > 1){
foreach($arr as $val) {
$return_str .= ' > <a href="'.$site.$val.'/">'.$bc_label[$val].'</a>';
$site .= $val.'/';
}
} elseif($num == 1) {
$arr = $str;
$return_str .= ' > <a href="'.$bc_site.$arr.'/">'.$bc_label[$arr].'</a>';
}
return $return_str;
}
?>