How to check if the client is on intra-net or inter-net?
I tried this:
function isLocal(){
$ip=$_SERVER["REMOTE_ADDR"];
return $ip=="127.0.0.1"||startsWith($ip,"192.168.")||startsWith($ip,"10.")||startsWith($ip,"172.16.");
}
But is this enought? I think no, moreover this fails with ipV6 address, is there a smarter way?