['Page Name', 'pageIcon'] */ $menu_items = [ 'index.php' => ['Home', 'logo.png'], 'alchemyIngredientPage.php' => ['Alchemy', 'alchemy.png'], 'blacksmithing.php' => ['Blacksmithing', 'blacksmithing.png'], 'engineering.php' => ['Engineering', 'engineering.png'], 'jewelcrafting.php' => ['Jewelcrafting', 'jewelcrafting.png'], 'leatherworking.php' => ['Leatherworking', 'leatherworking.png'], 'tailoring.php' => ['Tailoring', 'tailoring.png'], ]; $active_profession = ''; // File Name, e.g., 'alchemyIngredientPage' or 'blacksmithing' $active_profession_title = ''; // Page Name, e.g., 'Alchemy' or 'Blacksmithing' /* Finds & Sets Active Profession Page */ foreach ($menu_items as $file => $info) { $root_file_name = pathinfo($file, PATHINFO_FILENAME); // Extracts File Name ONLY, Not File Path if (str_starts_with($current_file, $root_file_name)) { $active_profession = $root_file_name; $active_profession_title = $info[0]; break; } }