PHP code example of teguh02 / php_indonesia_region

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

    

teguh02 / php_indonesia_region example snippets


$province = Region::query("all provinces") -> get();
 
$province = Region::query("province with id = 36") -> get();

$province = Region::query("provinces with id in array [36, 51, 34, 61, 71]") -> get();

$regencies = Region::query("regencies with id_province = 33") -> get();
 
$regencies = Region::query("regencies with id_province in array [32, 33]") -> get();
 
$districts = Region::query("districts with id_regency = 3302") -> get();
 
$villages = Region::query("villages with id_district = 330227") -> get();

composer