I have an application that has an included header file in each page. The pages are not organised into folder dues to the nature of my app and because included files within pages tend to break.
So I am trying to use breadcrumbs by having two arrays about the header include. One with the page names and one with their corresponding URLs, as so:
$breadCrumbs=array("Department Managment", "Class Managment"); //The breadcrumb page names
$breadLinks=array("/department.php","/class.php"); //The breadcrumb URLs
require_once "../include/headers.php"; //Include header
What I really need help with is the foreach loop. Here is what I have so far:
<?php
foreach ($breadCrumbs as $bc){
foreach ($breadLinks as $bl){
echo ("<li class='ELEMENT-crumb'><a href='" . $bl ."'>" . $bc . "</a></li>");}} ?>
However this returns four breadcrumbs in this order:
Department Managment - /department.php
Department Managment - /class.php
Class Managment - /department.php
Class Managment - /class.php
Any help would be appreciated, thanks.