A mechanism for discovering the IP of the computer using PHP CLI
Last active
August 15, 2016 12:07
-
-
Save WengerK/460add20a4e3f82ab0d3698e858a297e to your computer and use it in GitHub Desktop.
What's my IP using PHP CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php -r 'echo file_get_contents("http://ip.appspot.com/") . "\n";' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php -r "echo gethostbyname(php_uname('n'));" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment