PHP code example of muhamadrezaar / country

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

    

muhamadrezaar / country example snippets

 sh 
$countries = Country::getAll();

foreach($countries as $country)
{
		// echo $data->name; Menampilkan nama 
		// echo $data->topLevelDomain[0]; Menampilkan domain Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
		// echo $data->alpha2Code; Menampilkan 2 digit kode 
		// echo $data->alpha3Code; Menampilkan 3 digit kode 
		// echo $data->callingCodes[0]; Menampilkan kode telpon  Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
		// echo $data->capital; Menampilkan ibu kota 
		// echo $data->altSpellings[0]; Menampilkan ejaan Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
		// echo $data->region; Menampilkan region atau benua
		// echo $data->subregion; Menampilkan sub region
		// echo $data->translations->ja; menampilkan data nama negara berdasarkan ejaan negara lain tersedia beberapa negara : ->ja,->de,->es,->fr,->it
		// echo $data->population; Menampilkan data populasi
		// echo $data->latlng[0] lattitude
		// echo $data->latlng[1] longitude
		// echo $data->demonym 
		// echo $data->area 
		// echo $data->gini 
		// echo $data->timezones[0] Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
		// echo $data->nativeName 
		// echo $data->numericCode 
		// echo $data->currencies[0] Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
		// echo $data->languages[0] Notes: array bisa di isi selain 0 , tergantung banyaknya informasi data
}