PHP code example of calibr / country-mobile-carriers

1. Go to this page and download the library: Download calibr/country-mobile-carriers 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/ */

    

calibr / country-mobile-carriers example snippets



$carriers = CountryMobileCarriers::getList("RU");

/**
 * carriers array will look like this:
 * [
 *   [
 *     "name" => "Baykal Westcom",
 *     "mcc" => 250,
 *     "mnc" => 12
 *   ],
 *   ...
 * ]
 */

// returns whole database as array, key is country code, value is list of carriers
// in same format as in getList
$allCarriers = CountryMobileCarriers::getAll();