note 109980 deleted from function.ip2long by danbrown
| From: | danbrown@php.net | Date: | Wed, 12 Sep 2012 17:31:06 +0000 |
| Subject: | note 109980 deleted from function.ip2long by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190669@lists.php.net to get a copy of this message | ||
Note Submitter: Ellesmess
----
Small mhakopian's function modofication:
function isIpRange($aStart, $aEnd = null, $aIP = null) {
if($aIP === null) {
$aIP = $_SERVER['REMOTE_ADDR'];
}
return ($aEnd === null) ? ($aEnd == $aIP) : (ip2long($aStart) <= ip2long($aIP) &&
ip2long($aEnd) >= ip2long($aIP));
}