PHP Classes

PHP Extract Address Text: Parse address details extracted from string

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-02-14 (10 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 17 All time: 11,149 This week: 177Up
Version License PHP version Categories
php-extract-address- 1.0GNU General Publi...5PHP 5
Description 

Author

This package is specific mainly for applications used in Brazil Brazil .

This class can parse address details extracted from a string.

It can take a string with an address from a location in Brazil.

The class returns an array with street name, street number, and complement string strings.

In Portuguese:

Extrair rua, número e complemento de uma string

Picture of Moisés Lima
  Performance   Level  
Name: Moisés Lima <contact>
Classes: 5 packages by
Country: Brazil Brazil
Innovation award
Innovation award
Nominee: 3x

Example

#!/usr/bin/php -q
<?php

require_once 'Extract.php';

$ends = [
   
'Avenida Master Clase,701, apt 402',
];

$PhpExtractAddress = new PhpExtractAddress;

foreach(
$ends as $string){

   
$result = $PhpExtractAddress->extract($string);

   
$join = [];
    foreach(
$result as $r){

        if(
$r !== ''){
           
$join[] = $r;
        }
    }
   
    print
$string.str_repeat('·', 50 - strlen($string)).implode(', ', $join).PHP_EOL;
}


  Files folder image Files  
File Role Description
Accessible without login Plain text file cli.php Example Example script
Plain text file Extract.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text

 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:0
All time:11,149
This week:177Up