-
-
Save Pablohn26/063e0a36947861ea89fdf896156b6aa6 to your computer and use it in GitHub Desktop.
MACVendors.com API :: PHP GET Example
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 | |
$mac_address = "FC:FB:FB:01:FA:21"; | |
$url = "https://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