PHP code example of countrytext / extracting-country-from-text

1. Go to this page and download the library: Download countrytext/extracting-country-from-text 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/ */

    

countrytext / extracting-country-from-text example snippets


$country = new ExtractCounty([
    "searchWord" => "korea", // se, // optional
    "language" => "en", // optional
]);

$country->getCountryFullName(); // Array ( [0] => Korea (Democratic People's Republic of) [1] => Korea, Republic of )
$country->getCountryTwoLetter(); // Array ( [0] => kp [1] => kr )
$country->getCountryThreeLetter(); // Array ( [0] => prk [1] => kor )