Function __global->normalise_ip_address

Definitions

sources/global.php

  • Normalise/fix a provided IP address, including wildcarding part of it if requested.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$ip IP No No required parameter N/A N/A The IP address to normalise
$amount ?integer No No Null N/A N/A The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled. (null: wildcards not allowed)

Returns

  • The normalised IP address
  • Type: IP
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Normalise/fix a provided IP address, including wildcarding part of it if requested.
 *
 * @param  IP $ip The IP address to normalise
 * @param  ?integer $amount The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled. (null: wildcards not allowed)
 * @return IP The normalised IP address
 */

function normalise_ip_address(string $ip, ?int $amount = null) : string
 

sources/minikernel.php

  • Normalise/fix a provided IP address, including wildcarding part of it if requested.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$ip IP No No required parameter N/A N/A The IP address to normalise
$amount ?integer No No Null N/A N/A The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled. (null: wildcards not allowed)

Returns

  • The normalised IP address
  • Type: IP
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Normalise/fix a provided IP address, including wildcarding part of it if requested.
 *
 * @param  IP $ip The IP address to normalise
 * @param  ?integer $amount The number of groups to include in the IP address (rest will be replaced with *'s). For IP6, this is doubled. (null: wildcards not allowed)
 * @return IP The normalised IP address
 */

function normalise_ip_address(string $ip, ?int $amount = null) : string