Skip to content

Instantly share code, notes, and snippets.

@iwek iwek/traceroute.php
Last active Apr 1, 2020

What would you like to do?
PHP Curl call to get a Traceroute with Pingdom API
$ch = curl_init();
// 2. set the options, including the url
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("App-Key: YOUR-KEY-HERE"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
if ($output === FALSE) {
echo "cURL Error: " . curl_error($ch);
} else {
$response = json_decode($output,true);
echo $response['traceroute']['result'];
//free up the curl handle

This comment has been minimized.

Copy link
Owner Author

iwek commented Mar 8, 2013

An improved version is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.