Skip to content

Instantly share code, notes, and snippets.

@kzwkt
Forked from bkilshaw/gist:3624901
Created April 9, 2018 06:35
Show Gist options
  • Save kzwkt/563fcb6b2a462d09c6f5796f5b771609 to your computer and use it in GitHub Desktop.
Save kzwkt/563fcb6b2a462d09c6f5796f5b771609 to your computer and use it in GitHub Desktop.
MACVendors.com API :: PHP GET Example
<?php
$mac_address = "FC:FB:FB:01:FA:21";
$url = "http://api.macvendors.com/" . urlencode($mac_address);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if($response) {
echo "Vendor: $response";
} else {
echo "Not Found";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment