PHP code example of parziphal / world-data

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

    

parziphal / world-data example snippets


use Parziphal\WorldData\Countries;

// Get all data columns
$countries = Countries::get();

// Get only country names
$countries = Countries::get(['name']);

// Get both "names" and "iso_code_2" columns, and change "iso_code_2" column name to just "iso"
$countries = Countries::get(['name', 'iso_code_2' => 'iso']);