Function __global->get_server_names

Definitions

sources/global3.php

  • Get possible hostnames of the server.In order of what is most likely what the server considers itself.Also see get_domain() and get_request_hostname() and get_base_url_hostname() and get_localhost_names().
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$include_non_web_names boolean No No True N/A N/A Whether to include names that may not be for a web domain
$include_equivalents boolean No No True N/A N/A Whether to include www vs non-www equivalents

Returns

  • Host names
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get possible hostnames of the server.In order of what is most likely what the server considers itself.Also see get_domain() and get_request_hostname() and get_base_url_hostname() and get_localhost_names().
 *
 * @param  boolean $include_non_web_names Whether to include names that may not be for a web domain
 * @param  boolean $include_equivalents Whether to include www vs non-www equivalents
 * @return array Host names
 */

function get_server_names(bool $include_non_web_names = true, bool $include_equivalents = true) : array