Posts

Showing posts with the label Areas

Nigerian 36 States, Capital & Local Government Areas PHP Class

I got the inspiration of updating and sharing this PHP Class after a good  Don Jajo of mine did.... I thought i should at least spare some time as he did to FORK the repo via https://github.com/donjajo/NGStatesLGA so i can contribute to the PHP Class as someone wished if the methods can be at least Chain-able. And now, its not only Chain-able but i added and modify some methods... User Guide Do not mind as the code samples may look like as i am not so good in blogging -- require "nsl.php"; -- $nsl = new NSL('nsl_data') ; // pass as argument path/to/nsl_data file without extention, only json format supported for now  Getting Results To get raw result as it is fetched from the nsl_data file to do your manipulation yourself, use -- $result = $nsl->get(); To get all the states -- $result = $nsl->state()->get(); // returns array of states To get states and their capital  -- $result = $nsl->stateAndCapital()->get(); To get lo...