<?
/* example code */
include('storeip.php');
$IP=new storeip;
$ips=array('0.0.0.0','255.255.255.255','127.127.128.128','10.123.0.4','247.6.0.13','156.256.0.0');
foreach ($ips as $ip)
{
echo $IP->get_decoded($ip)."\n";
$IP->decode($ip);
if($ip==false && is_bool($ip)) echo 'wrong number';
else echo $ip."\n";
echo $IP->get_encoded($ip)."\n";
$IP->encode($ip);
if($ip==false && is_bool($ip)) echo 'wrong number';
else echo $ip."\n";
}
/*
The get_ calls return the decode/encode value
but don't change your original IP-variable.
*/
?>
|