PHP Classes

File: class/phoneNumbers.config.php

Recommend this page to a friend!
  Classes of David Domingues   PHP String Manipulation Library   class/phoneNumbers.config.php   Download  
File: class/phoneNumbers.config.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: PHP String Manipulation Library
Validate and manipulate text strings in a few ways
Author: By
Last change:
Date: 4 years ago
Size: 1,565 bytes
 

Contents

Class file image Download
<?php
//Define pattern for each country according to https://en.wikipedia.org/wiki/National_conventions_for_writing_telephone_numbers
//Complete this array for more countries. This is supplied as sample only.
return array(
    array(
       
'country' => 'PT',
       
'countryName' => 'Portugal',
       
'countrySeparator' => '()',
       
'charSeparators' => array('-', '+', ' '),
       
'numCountry' => '351',
       
'acceptedMask' => array('/9[1236][0-9]{7}$/', '/2[12][0-9]{7}$/', '/2[0-9]{9}$/'),
       
'minLength' => 9,
       
'maxLength' => 10
   
),
    array(
       
'country' => 'BE',
       
'countryName' => 'Belgium',
       
'countrySeparator' => '()',
       
'charSeparators' => array('-', '+', ' ', '/', '.'),
       
'numCountry' => '32',
       
'acceptedMask' => array('/0[0-9]{8}$/', '/04[0-9]{8}$/', '/4[0-9]{8}$/'),
       
'minLength' => 9,
       
'maxLength' => 10
   
),
    array(
       
'country' => 'DE',
       
'countryName' => 'Germany',
       
'countrySeparator' => '()',
       
'charSeparators' => array('-', '+', ' '),
       
'numCountry' => '49',
       
'acceptedMask' => array('/0[0-9]{10}$/', '/0[0-9]{12}$/', '/[0-9]{10}$/'),
       
'minLength' => 10,
       
'maxLength' => 12
   
),
    array(
       
'country' => 'FR',
       
'countryName' => 'France',
       
'countrySeparator' => '()',
       
'charSeparators' => array('-', '+', ' '),
       
'numCountry' => '33',
       
'acceptedMask' => array('/0[0-9]{9}$/'),
       
'minLength' => 10,
       
'maxLength' => 10
   
)
)

?>