PHP Classes

Italian Cities and Postal Code checker: Search Italian cities, postal codes and addresses

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: 68 All time: 10,325 This week: 455Up
Version License PHP version Categories
italian-cities 1.0GNU Lesser Genera...5PHP 5, Web services, Geography
Description 

Author

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

This class can search Italian cities, postal codes and addresses.

It can send HTTP requests to the RiceVitoriaOnline.it API to search for a given Italian city, postal code or address.

The class decodes the results and returns an array that may include the location province, city, city extension, city fraction, city fraction extension, address name, address name extension, address type, address numeration, complete address and postal code.

Innovation Award
PHP Programming Innovation award nominee
June 2016
Number 8


Prize: SourceGuarding PHP encoder tool
When you need to send letters or packages via the postal system, you need to enter the correct destination and the respective postal code.

This class can get the postal code of a city or the city of a postal code for locations in Italy.

Manuel Lemos
Picture of Orazio Principe
  Performance   Level  
Name: Orazio Principe is available for providing paid consulting. Contact Orazio Principe .
Classes: 8 packages by
Country: Italy Italy
Age: 48
All time rank: 64123 in Italy Italy
Week rank: 200 Up9 in Italy Italy Up
Innovation award
Innovation award
Nominee: 4x

Winner: 2x

Example

<?php
/**
 * Owner: Principe Orazio
 * Date: 20/05/16
 * Time: 09:20
 *
 * Test file for ItalianCities class
 */
require_once ("ItalianCities.php");

$ic = new ItalianCites();

//Just for this example we can get max. 2 records for each call
$records = 2;

//Search by city
$city = "Roma";
$results = $ic->getCurlResults($city,null,null,$records);
var_dump($results);

echo
"<hr>";

//Search by postalCode
$postalCode = "01034";
$results = $ic->getCurlResults(null,null,$postalCode,$records);
var_dump($results);

echo
"<hr>";

//Search by city and address
$city = "Roma";
$address = "Via Aurelia";
$results = $ic->getCurlResults($city,$address,null,$records);
var_dump($results);

echo
"<hr>";

//Test city and cap -> correct
$city = "Roma";
$postalCode = "00199";
$results = $ic->verify($city,null,$postalCode);
var_dump($results);


echo
"<hr>";

//Test city and cap -> wrong
$city = "Roma";
$postalCode = "10100";
$results = $ic->verify($city,null,$postalCode);
var_dump($results);


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file test1.php Example Test file
Plain text file ItalianCities.php Class Main Class

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  
 0%
Total:68
This week:0
All time:10,325
This week:455Up