"Department of Emergency Medicine", "Surgery" => "Department of Surgery", "Medicine" => "Department of Medicine", "Women's and Children's Health" => "Department of Women's and Children's Health", "Biomedical Science" => "Department of Biomedical Science", "Population Health" => "Department of Population Health", "Clinical Neurosciences" => "Department of Clinical Neurosciences", ]; // Extract and organize unique department names $uniqueDepartments = []; foreach ($filteredData as $f) { $departments = array_map('trim', explode(',', $f["department"])); // Split department names by comma and trim spaces // Update department names based on $customDepartmentNames $departments = array_map(function ($department) use ($customDepartmentNames) { return isset($customDepartmentNames[$department]) ? $customDepartmentNames[$department] : $department; }, $departments); foreach ($departments as $department) { if (!in_array($department, $uniqueDepartments)) { $uniqueDepartments[] = $department; } } } // Extract "Office of the Dean" from $uniqueDepartments $officeOfTheDean = array_filter($uniqueDepartments, function ($department) { return $department === "Office of the Dean"; }); // Remove "Office of the Dean" from $uniqueDepartments $uniqueDepartments = array_filter($uniqueDepartments, function ($department) { return $department !== "Office of the Dean"; }); // Sort the remaining department names sort($uniqueDepartments); // Merge "Office of the Dean" back to the sorted list array_unshift($uniqueDepartments, reset($officeOfTheDean)); // Generate the select menu echo '
| Name | Title | Phone | |
|---|---|---|---|
| '; if(isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== false) { echo ''; }elseif (isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== true) { echo ''; }else { } echo $name; echo $f["custom_creds"]; if(isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== false) { echo ' '; }elseif (isset($f["url"]) && !empty($f["url"]) && strpos($f["url"], 'https://www.fau.edu') !== true) { echo ' '; }else { } echo ' | '; echo ''.$f["description"].' | '; echo ''; $phone = $f["phone"]; // Only display allowed phone numbers if(strpos($phone, "561-737-") === 0 || strpos($phone, "561-799-") === 0 || strpos($phone, "561-297-") === 0 || strpos($phone, "561-566-5328") === 0 || strpos($phone, "561-955-") === 0 || strpos($phone, "561-733-") === 0 || strpos($phone, "561-825-9699") === 0 || strpos($phone, "561-430-3629") === 0) {echo $f["phone"];} echo ' | '; echo ''; if(isset($f["email"]) && !empty($f["email"])) { echo ' '.$f["email"].''; } echo ' | '; echo '