"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 & Social Medicine" => "Department of Population Health & Social Medicine", "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 '
'; echo '
'; // Sort the filtered data by last name usort($filteredData, function ($a, $b) { return strcasecmp($a['name'], $b['name']); }); // Process the filtered data foreach ($filteredData as $f) { // Define an array of email addresses to exclude $emailsToExclude = [ 'davidgreen@fau.edu','ademner@health.fau.edu','sgografe@fau.edu','cwhitehair@health.fau.edu','doctor@neiledisonmd.com','nedison@health.fau.edu','yua@fau.edu','yua@health.fau.edu' // Add the email addresses you want to exclude here ]; $email = strtolower(trim($f['email'])); // Skip employees with email addresses in the exclusion list if (in_array($email, $emailsToExclude)) { continue; } // Remove "Dr. " from the name field, if it's present $name = preg_replace('/\bDr\. \s*/i', '', $f["name"]); $nameDr = preg_replace('/\bDr\., \s*/i', ', ', $name); $namePhDPhD = preg_replace('/,\s*Ph\.D\.\s*,\s*Ph\.D\.\s*/i', ', Ph.D.', $nameDr); $name = preg_replace('/\s*,/', ',', $namePhDPhD); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } 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 ''.$f["description"].''; $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) {echo $f["phone"];} echo '
No faculty or staff matches your search.

Try changing filters above or  click here  to see all the results.

'; ?>