PHP code example of megastruktur / phone-country-codes

1. Go to this page and download the library: Download megastruktur/phone-country-codes 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/ */

    

megastruktur / phone-country-codes example snippets


// Return the list of phone codes:
\megastruktur\PhoneCountryCodes::getCodesList();

/* Return the full array of codes and details:
 *  "country_code" => [
 *    "name",
 *    "dial_code",
 *    "code",
 *  ]
*/
\megastruktur\PhoneCountryCodes::getCodesFullList();