when I try to run the follow breadcrumbs code, I receive the following error.
Parse error: syntax error, unexpected '=', expecting ')' in C:\Inetpub\wwwroot\includes\crumbs.php on line 8
here is the code I am using for the breadcrumbs
Code: Select all
<?php
echo '<ul id="crumbs">
';
/* get array containing each directory name in the path */
$parts = explode("/", dirname($REQUEST_URI));
echo '<li><a href="/">Home</a></li>
';
foreach ($parts as $key =(> $dir) {
switch ($dir) {
<strong>case "about": $label = "About Us"; break;</strong>
/* if not in the exception list above,
use the directory name, capitalized */
default: $label = ucwords($dir); break;
}
/* start fresh, then add each directory back to the URL */
$url = "";
for ($i = 1; $i <= $key; $i++)
{ $url .= $parts[$i] . "/"; }
if ($dir != "")
echo "<li>> <a href="/$url">$label</a></li>
";
}
echo "</ul>
";
?>regards,
Bruce