IsLocalHost
Last updated
Was this helpful?
Determine whether a given string value represents a loopback IP address, like localhost, 127.0.0.1 or ::1.
IsLocalHost(ip=[string])ip
string
true
String representing the IP address to test.
isLocalHost( "127.0.0.1" );
Result: true
Test the IPv6 Loopback address. IPv6 only has one loopback address.
Result: true
IPv4 network standards reserve the entire 127.0.0.0/8 address block for loopback networking purposes however they are not usually mapped to localhost by default.
Result: true
Not a localhost IP.
Result: false
Last updated
Was this helpful?
Was this helpful?
isLocalHost( "::1" );
isLocalHost( "127.8.8.8" );
isLocalHost( "8.8.8.8" );
ip = "127.0.0.1";
writeDump( islocalhost( ip ) ); // true
writeDump( islocalhost( GetLocalHostIP() ) );
// true
