$ip1 = '192.168.0.1'; $ip2 = '192.168.0.2'; if (t3lib_div::cmpIP($ip1, $ip2)) { echo 'The two IP addresses are the same'; } else { echo 'The two IP addresses are different'; }
$ip1 = '192.168.0.1'; $ip2 = '192.168.0.1'; if (t3lib_div::cmpIP($ip1, $ip2)) { echo 'The two IP addresses are the same'; } else { echo 'The two IP addresses are different'; }This example compares two IP addresses and returns "The two IP addresses are the same" since they are the same. Package library: TYPO3 CMS (t3lib_div is a part of the TYPO3 CMS core).