PHPackages                             empregoligado/brazilian-phone-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. empregoligado/brazilian-phone-validator

AbandonedArchivedLibrary[Validation &amp; Sanitization](/categories/validation)

empregoligado/brazilian-phone-validator
=======================================

Validator for Brazilian phone numbers

v0.0.8(11y ago)183.6k3MITPHPPHP &gt;=5.3.0

Since Aug 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/EmpregoLigado/BrazilianPhoneValidator)[ Packagist](https://packagist.org/packages/empregoligado/brazilian-phone-validator)[ Docs](http://github.com/EmpregoLigado/BrazilianPhoneValidator)[ RSS](/packages/empregoligado-brazilian-phone-validator/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (11)Used By (0)

BrazilianPhoneValidator
=======================

[](#brazilianphonevalidator)

This library provides a validator for Brazilian telephone numbers based on the ranges of telephone numbers from Anatel. It provides validation rules for the main telephone types:

- Cellphones - [SMP](http://tinyurl.com/anatel-smX), *Serviço Móvel Pessoal*(Personal Mobile Service) in the Anatel specifications
- Landline phones - [STFC](http://tinyurl.com/anatel-stfc), *Serviço Telefônico Fixo Comutado* (Switched Landline Telephone Service) in the Anatel specifications
- Push-to-talk phones - [SME](http://tinyurl.com/anatel-smX), *Serviço Móvel Especializado* (Specialized Mobile Service) in Anatel specifications

[![Build Status](https://camo.githubusercontent.com/d70cd2255b821a55da1945e609c1b4d8fa618cf37ebcdff1573c42ccd1562fac/68747470733a2f2f7472617669732d63692e6f72672f456d707265676f4c696761646f2f4272617a696c69616e50686f6e6556616c696461746f722e706e67)](https://travis-ci.org/EmpregoLigado/BrazilianPhoneValidator)

What is Anatel?
---------------

[](#what-is-anatel)

According to [Wikipedia](http://en.wikipedia.org/wiki/Brazilian_Agency_of_Telecommunications):

> "The National Telecommunications Agency (in Portuguese, Agência Nacional de Telecomunicações - Anatel) is a special agency in Brazil created by the general telecommunications act (Law 9472, 16/07/1997) in 1997. The agency is administratively and financially independent, and not hierarchically subordinate to any government agency."

Requirements
------------

[](#requirements)

PHP 5.3 or above.

Installation
------------

[](#installation)

The easiest way to install BrazilianPhoneValidator is [through Composer](http://getcomposer.org/). Just create a `composer.json` file for your project:

```
{
    "require": {
        "empregoligado/brazilian-phone-validator": "dev-master"
    }
}
```

And then run these commands:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar install

```

Now include the Composer-generated autoload to have access to the library:

```
