PHP Classes

PHP Extract Address Text: Parse address details extracted from string

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 17 All time: 11,405 This week: 40Up
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 (3)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:0
All time:11,405
This week:40Up