PHP code example of phaza / norwegian-address-data
1. Go to this page and download the library: Download phaza/norwegian-address-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/ */
phaza / norwegian-address-data example snippets
$sosiparser = new SOSIParser(
function ( Address $address ) {
//Do something with $address here
}
);
$handle = fopen( 'somefile.sos', 'r' );
$sosiparser->parse( $handle );
fclose( $handle );
$sosiparser = new SOSIParser(
function ( Address $address ) {
//Do something with $address here
}
);
$file = new SplFileInfo('Vegdata_Norge_Adresser_UTM33_SOSI.zip');
$unwrapper = new ZipUnwrapper( $file, $sosiparser );
$unwrapper->parse();