Skip to content

Instantly share code, notes, and snippets.

@angristan
Created January 23, 2018 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angristan/9759e2b51e730a1bde0090be39d96184 to your computer and use it in GitHub Desktop.
Save angristan/9759e2b51e730a1bde0090be39d96184 to your computer and use it in GitHub Desktop.
Get the client IP address and reverse DNS
<?php
echo $_SERVER['REMOTE_ADDR'];
echo "<br>";
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $hostname;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment