dmamontov / phone-normalizer
Normalizer phone numbers.
Installs: 33 349
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.3
This package is auto-updated.
Last update: 2024-12-18 06:58:37 UTC
README
Phone Normalizer
Pars, normalizes the phone number and results in a specified format.
Requirements
- PHP version >=5.3.3
Installation
-
Install composer
-
Follow in the project folder:
composer require dmamontov/phone-normalizer ~1.0.1
In config composer.json
your project will be added to the library dmamontov/phone-normalizer
, who settled in the folder vendor/
. In the absence of a config file or folder with vendors they will be created.
If before your project is not used composer
, connect the startup file vendors. To do this, enter the code in the project:
require 'path/to/vendor/autoload.php';
Examples of use
use DmitryMamontov\PhoneNormalizer\PhoneNormalizer; $n = new PhoneNormalizer; $n->loadCodes('vendor/dmamontov/phone-normalizer/codes/codes.json'); $phone = $n->normalize('XXXXXXXXXXXXXX'); var_dump($phone->format('+#CC#(#c#)###-##-##'));