PHP比较IP大小
function cmpLoginIP($a, $b) { return bindec(decbin(ip2long($a['loginIp']))) > bindec(decbin(ip2long($b['loginIp']))); } function cmpLoginIPDesc($a, $b) { return bindec(decbin(ip2long($b['loginIp']))) > bindec(decbin(ip2long($a['loginIp']))); }