1. Go to this page and download the library: Download coderatio/ngstates 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/ */
coderatio / ngstates example snippets
// If you downloaded the library using composer
ser.
oderatio\NGStates\NGStates();
/*
* Note: You can use the helper function which is an instance of NGStates::class.
* e.g ngstates()->getStates();
*/
print_r($ngStates->getStates()); // Print all the states
exit;
// Get states
$ngStates->getStates();
// This will return an array of all states.
// Get State
$ngStates->getState(string|int $stateNameOrId);
// e.g
$ngStates->getState(26);
// OR
$ngStates->getState('Nasarawa State');
// Get state local governments
$ngStates->getStateLocals(string|int $stateNameOrId);
// e.g
$ngStates->getStateLocals(26);
// OR
$ngStates->getStateLocals('Nasarawa State');
// Get state local government
$ngState->getStateLocal(string|int $stateNameOrId, string|int $localNameOrId);
// e.g
$ngStates->getStateLocal(26, 1);
// OR
$ngStates->getStateLocal('Nasarawa State', 'Lafia');
// Delete state
$ngStates->deleteState(int $stateNameOrId);
// e.g
$ngStates->deleteState(38);
// Delete state local government
$ngStates->deleteStateLocal(string|int $stateNameOrId, int $stateLocalId);
// e.g
$ngStates->deleteStateLocal(38, 1); // Will delete local government with the ID 1.
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.