PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
  Classes of Samy Massoud  >  PHP Mac Address Vendor Lookup  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example how to use class
Class: PHP Mac Address Vendor Lookup
Get vendor information from mac address
Author: By
Last change:
Date: 3 years ago
Size: 712 bytes
 

 

Contents

Class file image Download
<?php
include "src/MacvendorsApi.php";
use \
macvendors_co;

$api = new \macvendors_co\MacVendorsApi();
/**
Get And parse data to array

**/
$vendor = $api->get_vendor ("08:74:02:00:00:00",'csv');
echo
$vendor['company'].'<br/>';
echo
$vendor['mac_prefix'].'<br/>';
echo
$vendor['address'];

//Get raw data XML
$vendor = $api->get_vendor_xml("08:74:02:00:00:00");
echo
'<pre>'.$vendor.'</pre>' ;
//Get raw data CSV
$vendor = $api->get_vendor_csv("08:74:02:00:00:00");
echo
'<pre>'.$vendor.'</pre>' ;
//Get Raw data JSON
$vendor = $api->get_vendor_json("08:74:02:00:00:00");
echo
'<pre>'.$vendor.'</pre>' ;
//get raw data PIPE
$vendor = $api->get_vendor_pipe("08:74:02:00:00:00");
echo
'<pre>'.$vendor.'</pre>' ;