All pastes #479413 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-09 18:52 UTC
rendered paste body
<?php

function isLastIp() {
    $lastip = explode('.','192.168.1.50');
    $currentip = explode('.',$_SERVER['REMOTE_ADDR']);

    for ($i = 0; $i <= 2; $i++) {
        echo 'testing ' . $currentip[$i] . ' against ' . $lastip[$i] . '<br />';
        if ($currentip[$i] != $lastip[$i]) return false;
    }

    return true;
}

echo 'isLastIp() returns <b>';
if (isLastIp()) echo 'true';
else            echo 'false';
echo '</b>';

?>