¡Hola, amigos! I’m Señor FAQ, the mustached maestro of questions and answers! With my trusty glasses and a book of endless wisdom, I turn dudas into solutions. Soy el héroe de los curiosos and the champion of clarity.
JScms_isIPBlocked
The JScms_isIPBlocked
function checks if a given IP address is within a blocked range or matches a specific blocked IP.
It supports IPv4 and IPv6 addresses and utilizes network masks for range-based blocking.
JScms_isIPBlocked($ip, $blockedIPs)
$ip
: (string) The IP address to check.$blockedIPs
: (array) A list of blocked IPs or ranges (e.g., ["192.168.1.0:255.255.255.0"]
).
(bool) Returns true
if the IP address is blocked, or false
otherwise.
<?php
$ip = "192.168.1.10";
$blockedIPs = ["192.168.1.0:255.255.255.0", "10.0.0.1"];
$isBlocked = JScms_isIPBlocked($ip, $blockedIPs);
if ($isBlocked) {
echo "IP is blocked.";
} else {
echo "IP is not blocked.";
}
?>
192.168.1.0:255.255.255.0
).