1. Go to this page and download the library: Download aaqib/geo-pakistan 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/ */
use Aaqib\GeoPakistan\Pakistan;
Pakistan::Provinces()
use Aaqib\GeoPakistan\Division;
Pakistan::Divisions()
use Aaqib\GeoPakistan\Models\Province;
$punjab = Province::getByAbbr('PUN');
$divisions = $punjab->divisions()->get();
// or use children method
$divisions = $punjab->children();
// get district by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$Lahore = $lahore_city->district();
// get division by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$lahore = $lahore_city->division();
// get province by tehsil
$lahore_city = Tehsil::getByName('Lahore City');
$Punjab = $lahore_city->province();
// get by province
$punjab = Province::getByAbbr('PUN');
$tehsils = $punjab->tehsils()->get();
// get by division
$rawalpindi = Division::getByName('Rawalpindi');
$tehsils = $rawalpindi->tehsils()->get();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.