Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // PHP using CURL example
- $mac_address = "D4:B7:61:27:2B:9D";
- $url = "https://api.macvendors.com/v1/lookup/" . urlencode($mac_address);
- $token = 'your token here';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer '.$token]);
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $response = curl_exec($ch);
- $response = json_decode($response);
- if (empty($response)) {
- echo "Not Found";
- } elseif ($data = $response->data) {
- var_dump($data);
- } elseif ($errors = $response->errors) {
- var_dump($errors);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement