Skip to content

Instantly share code, notes, and snippets.

@jakub-g
Created November 4, 2019 10:01
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 jakub-g/e48bf61faf000da06a24296ffabeb351 to your computer and use it in GitHub Desktop.
Save jakub-g/e48bf61faf000da06a24296ffabeb351 to your computer and use it in GitHub Desktop.
<?php
$remote = @$_SERVER['REMOTE_ADDR'];
printf("%s\n", (($name = gethostbyaddr($remote)) !== false) ? $name : $remote);
php -S localhost:8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment