public static function rewrite_x_powered_by_header($header_string, $existing_headers) { $fetch_powered_by_value = UBHTTP::fetch_header_value_function(UBHTTP::$powered_by_header_regex); $existing_powered_by = preg_grep(UBHTTP::$powered_by_header_regex, $existing_headers); $existing_powered_by = array_map($fetch_powered_by_value, $existing_powered_by); return 'X-Powered-By: ' . join($existing_powered_by, ', ') . ', ' . $fetch_powered_by_value($header_string); }