Function __global->ip_cidr_check
Definitions
sources/global.php
- Find if an IP address is within a CIDR range. Based on comment in PHP manual: http://php.net/manual/en/ref.network.php.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $ip | IP | No | No | required parameter | N/A | N/A | IP address |
| $cidr | SHORT_TEXT | No | No | required parameter | N/A | N/A | CIDR range (e.g. 204.93.240.0/24) |
Returns
- Whether it is
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find if an IP address is within a CIDR range. Based on comment in PHP manual: http://php.net/manual/en/ref.network.php.
*
* @param IP $ip IP address
* @param SHORT_TEXT $cidr CIDR range (e.g. 204.93.240.0/24)
* @return boolean Whether it is
*/
function ip_cidr_check(string $ip, string $cidr) : bool
* Find if an IP address is within a CIDR range. Based on comment in PHP manual: http://php.net/manual/en/ref.network.php.
*
* @param IP $ip IP address
* @param SHORT_TEXT $cidr CIDR range (e.g. 204.93.240.0/24)
* @return boolean Whether it is
*/
function ip_cidr_check(string $ip, string $cidr) : bool

