PHPackages                             alcea/cnp - 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. alcea/cnp

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

alcea/cnp
=========

PHP Validation for Personal Identification Number (Validare PHP pentru Cod Numeric Personal CNP)

3.0.2(1y ago)1175.0k—4.5%MITPHPPHP &gt;=7.4

Since Aug 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alceanicu/cnp)[ Packagist](https://packagist.org/packages/alcea/cnp)[ Docs](https://github.com/alceanicu/cnp)[ RSS](/packages/alcea-cnp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (5)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/c2440090e26ba40855a093bb96a0357e80de30172e7070325e879860c90286eb/68747470733a2f2f7472617669732d63692e6f72672f616c6365616e6963752f636e702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alceanicu/cnp) [![Latest Stable Version](https://camo.githubusercontent.com/32a987b6ef82b3c9d076c3583eb7ea5a128728256f3bd563a3d26a763a318a5d/68747470733a2f2f706f7365722e707567782e6f72672f616c6365612f636e702f762f737461626c652e737667)](https://packagist.org/packages/alcea/cnp) [![Total Downloads](https://camo.githubusercontent.com/8cd6cc1dfc49c8536ebee91943302e194ba22704607a92bb5017c3a428246e0b/68747470733a2f2f706f7365722e707567782e6f72672f616c6365612f636e702f646f776e6c6f6164732e737667)](https://packagist.org/packages/alcea/cnp) [![License](https://camo.githubusercontent.com/3b6fccecf94b70cdb13d37a657ffd9236a31c147798c225711c95d7e9dce3c09/68747470733a2f2f706f7365722e707567782e6f72672f616c6365612f636e702f6c6963656e73652e737667)](https://packagist.org/packages/alcea/cnp)

CNP
===

[](#cnp)

Validation for Romanian Social Security Number (Validare CNP).

From version 3.0 need PHP &gt;= 7.4 From version 2.0 was added possibility to extract some data from a valid CNP (see example below).

How to install?
---------------

[](#how-to-install)

### 1. use composer

[](#1-use-composer)

```
composer require alcea/cnp
```

### 2. or, edit require section from composer.json and run composer update

[](#2-or-edit-require-section-from-composerjson-and-run-composer-update)

```
"alcea/cnp": "^3.0"

```

### 3. if need PHP &lt; 7.4 use

[](#3-if-need-php--74-use)

```
"alcea/cnp": "2.1.6"

```

How to use?
-----------

[](#how-to-use)

```
