PHP Classes

File: cli.php

Recommend this page to a friend!
  Classes of Moisés Lima   PHP Extract Address Text   cli.php   Download  
File: cli.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Extract Address Text
Parse address details extracted from string
Author: By
Last change:
Date: 1 year ago
Size: 438 bytes
 

Contents

Class file image Download
#!/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;
}