I updated the code a little bit and did like this,
while ($mysql->fetch($row)){
$navigation_items[$row["page_name"]] = array(
"url" => $row["page_name"],
"name" => current(explode(".", ucwords($row["page_name"]))),
"home" => $row["is_home"]
);
}
which gives me this array,
Array
(
[Home] => Array
(
[url] => Home
[name] => Home
[home] => 1
)
[About] => Array
(
[url] => About
[name] => About
[home] => 0
)
[contact.php] => Array
(
[url] => contact.php
[name] => Contact
[home] => 0
)
)
and then finally I did like this,
if((isset($_GET["p"])) && (in_array($_GET["p"], $navigation[$_GET["p"]]))) {
$navigation[$_GET["p"]]["name"] = "<strong>{$navigation[$_GET["p"]]["name"]}</strong>";
}
foreach ($navigation as $nav) {
echo "<li><a href=\"{$nav["url"]}\">{$nav["name"]}</a></li>";
}
And this is working up to 33%; the problem is if you type in the wrong "case-lettering" say you type in "home" instead of "Home" or "HoMe" instead of "Home" (basically just the wrong "case") then you will get this,
Notice: Undefined index: homE in C:\xampp\htdocs\CMS\themes\default\layout\header.template.php on line 20
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\CMS\themes\default\layout\header.template.php on line 20
Is there a way to make the in_array not case-sensitive? Or "go around" it or do this another way so it wouldn't cause a problem?