Created
March 25, 2014 07:33
-
-
Save kimpepper/9756773 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Finds the host IP address by calling the httpbin web service. | |
* | |
* @return string | |
* The current hosts IP address. | |
*/ | |
function guzzle_example_get_host_ip() { | |
$client = new \GuzzleHttp\Client(); | |
$response = $client->get('http://httpbin.org/get'); | |
$json = $response->json(); | |
return $json['origin']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment