PHP code example of frdl / iana-enterprise-numbers-fetcher

1. Go to this page and download the library: Download frdl/iana-enterprise-numbers-fetcher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

frdl / iana-enterprise-numbers-fetcher example snippets


header('Content-Type: text/plain');
$Fetcher = new IanaPenListFetcher();
$result = $Fetcher();
 echo print_r(count($result), true). " Records found\n";
 
//This should search and find the SAME entry (by email, id, oid, name, org):
 echo print_r($Fetcher('[email protected]'), true). "\n";
 echo print_r($Fetcher(37553), true). "\n";
 echo print_r($Fetcher('1.3.6.1.4.1.37553'), true). "\n";
 echo print_r($Fetcher('Wehowski'), true). "\n";
 echo print_r($Fetcher('frdl'), true). "\n";
 
 
$Fetcher->setRoot('1.3.6.1.4.1');
$Fetcher->setUrl('https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers');
$Fetcher->setCachelimit(60 * 60);
$Fetcher->setCachefile(__DIR__.\DIRECTORY_SEPARATOR.'penlist.php');