I'm creating a dynamic breadcrumb menu, it's grabbing the url and outputting each directory to the end user correctly but for example if you click the first breadcrumb link after home, it's still using the FULL url and also adding 'array to the end too'. I'll post the code below to make some send of this and screenshots.
PHP/HTML
<?php
$crumbs = explode("/",$_SERVER["REQUEST_URI"]);
foreach($crumbs as $crumb){
ucfirst(str_replace(array(".php","_"),array(""," "),$crumb) . ' ');
}
?>
<div class="breadcrumb">
<ul>
<li><a href="<?php HTTP_HOST ?>">Home</a></li>
<?php foreach($crumbs as $crumb){ ?>
<li><a href="<?php echo $crumbs; ?>"><?php echo $crumb; ?></a></li>
<?php } ?>
</ul>
</div>
How it appears so far:
The link which it tried to load when I clicked In-House-Training for an example.