PHPackages                             felipteko/mx-curp - 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. felipteko/mx-curp

ActiveLibrary

felipteko/mx-curp
=================

Herramientas para CURP de Mexico

v0.1.4(1y ago)019MITPHP

Since Mar 26Pushed 1y agoCompare

[ Source](https://github.com/felipeteko/php-mx-curp)[ Packagist](https://packagist.org/packages/felipteko/mx-curp)[ RSS](/packages/felipteko-mx-curp/feed)WikiDiscussions master Synced 1mo ago

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

Herramientas en PHP para CURP de México
=======================================

[](#herramientas-en-php-para-curp-de-méxico)

Conjunto de herramientas en PHP para la validación de la Cláve Única de Registro de Población en México.

Instalación
-----------

[](#instalación)

La instalación se puede realizar mediante [composer](https://getcomposer.org).

```
composer require francerz/mx-curp
```

Utilización
-----------

[](#utilización)

```
use Francerz\MX_CURP\CURP;
use Francerz\MX_CURP\EntidadesFederativasEnum;
use Francerz\MX_CURP\SexosEnum;

$curp = new CURP('PERJ911109HCMRDN05');

/*
    VALIDAR CURP
    - Verifica estructura de la cadena.
    - Verifica presencia de palabras inconvenientes.
    - Prueba congruencia del dígito verificador.
*/
if (!$curp->esValida()) {
    throw new Exception("La CURP introducida es inválida.");
}

/*
    OBTENER FECHA DE NACIMIENTO
    Obtiene la fecha de nacimiento presente en la CURP en un objeto
    DateTimeImmutable.
*/
$fechaNacimiento = $curp->getFechaNacimiento();
// Salida: 1991-11-09T00:00:00+00:00
echo $fechaNacimiento->format(DateTimeInterface::W3C) . PHP_EOL;

/*
    OBTENER SEXO
    Obtiene el valor representativo del sexo
*/
switch ($curp->getSexo()) {
    case SexosEnum::HOMBRE:
        echo "Es HOMBRE" . PHP_EOL;
        break;
    case SexosEnum::MUJER:
        echo "Es MUJER" . PHP_EOL;
        break;
}

/*
    OBTENER ENTIDAD DE NACIMIENTO
    Obtiene los dígitos característicos de la entidad federativa de nacimiento.
*/
switch ($curp->getEntidadFederativa()) {
    case EntidadesFederativasEnum::AGUASCALIENTES:
        echo "Nació en Aguascalientes." . PHP_EOL;
        break;
    case EntidadesFederativasEnum::COLIMA:
        echo "Nació en Colima." . PHP_EOL;
        break;
    case EntidadesFederativasEnum::ZACATECAS:
        echo "Nació en Zacatecas." . PHP_EOL;
        break;
    case EntidadesFederativasEnum::NACIDO_EXTRANJERO:
        echo "Nació en el Extranjero." . PHP_EOL;
        break;
}

/*
    VERIFICAR CORRESPONDIENCIA DEL NOMBRE
    Realiza pruebas de los caracteres clave del nombre(s) para verificar su
    correspondencia.
*/
if (!$curp->esNombreValido('Juan')) {
    throw new Exception('El nombre no corresponde a la CURP.');
}

/*
    VERIFICAR CORRESPONDIENCIA DEL PRIMER APELLIDO
    Realiza pruebas de los caracteres clave del primer apellido para verificar
    su correspondencia.
*/
if (!$curp->esApellido1Valido('Pérez')) {
    throw new Exception('El primer apellido no corresponde a la CURP.');
}

/*
    VERIFICAR CORRESPONDIENCIA DEL SEGUNDO APELLIDO
    Realiza pruebas de los caracteres clave del segundo apellido para verificar
    su correspondencia.
*/
if (!$curp->esApellido2Valido('Rodríguez')) {
    throw new Exception('El segundo apellido no corresponde a la CURP.');
}

echo "Todo parece estar en orden." . PHP_EOL;
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance46

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

410d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f9d25388c0659822e85d5101db70f0f2fffb1ead369d06c17e99da0edd9c8c7?d=identicon)[felipeteko](/maintainers/felipeteko)

---

Top Contributors

[![francerz](https://avatars.githubusercontent.com/u/10836837?v=4)](https://github.com/francerz "francerz (6 commits)")[![felipeteko](https://avatars.githubusercontent.com/u/66437112?v=4)](https://github.com/felipeteko "felipeteko (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/felipteko-mx-curp/health.svg)

```
[![Health](https://phpackages.com/badges/felipteko-mx-curp/health.svg)](https://phpackages.com/packages/felipteko-mx-curp)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
