Hi all
I am tryng to build a function that I can re-use for any site. This function is for a breadcrumb trail and i'm nearly there but need help with the link part of the function (i think).
My function takes the full url (REQUEST_URI) via the variable $urlarray and what I need is for every array element, to display the name and link to the appropriate section. So far I have the name displayed but the linking is to the same page each time.
Can someone help with sorting the linking out so that it links ONLY to the page it should do?
Many Thanks
function displayBreadCrumb($urlarray) {
foreach($urlarray as $section) {
echo "<a href=\"/" .$urlarray[0]. "/" . $urlarray[1] . "/" .$urlarray[2]. "\">$section</a> > ";
}
}
P.S. I am guessing some kind of looping needs to go on to build the href part of the code but this is where i need help.