andersonteala/validate-phone

Validate a phone number

v1.0.0 2022-02-04 22:52 UTC

This package is auto-updated.

Last update: 2025-06-05 06:11:54 UTC


README

A simple phone validator, returning if the phone is mobile, landline or invalid. Valid only for Brazilian phones (first version).

Requirements

  • PHP
    • 7.0
    • or higher required

Installing

To install this dependency just run the command below:

composer require andersonteala/validate-phone

Example Usage

For your use, follow the example below:

<?php

require __DIR__ . '/vendor/autoload.php';

use AndersonTeala\ValidatePhone\ValidatePhone;

$validator = new ValidatePhone();

$numberData = [
  'ddd' => '11',
  'phone' => '920202020'
];

$type = $validator->validate($numberData);