PHPackages                             slwdc/nic-parser - 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. slwdc/nic-parser

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

slwdc/nic-parser
================

Sri Lankan national identity card number validator

v1.1.0(5y ago)205706[1 issues](https://github.com/slwdc/NICParser/issues)MITPHPCI failing

Since Jul 16Pushed 5y ago4 watchersCompare

[ Source](https://github.com/slwdc/NICParser)[ Packagist](https://packagist.org/packages/slwdc/nic-parser)[ RSS](/packages/slwdc-nic-parser/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (7)Used By (0)

Sri Lankan National Identity Card Number Parser
===============================================

[](#sri-lankan-national-identity-card-number-parser)

A PHP library to parse, validate, and generate valid Sri Lankan national identity card numbers.

[![Latest Stable Version](https://camo.githubusercontent.com/3b2881bbb7e44e0e2db621a40b9d2615d11460494d07b13dcaf5a2723153c972/68747470733a2f2f706f7365722e707567782e6f72672f736c7764632f6e69632d7061727365722f762f737461626c65)](https://packagist.org/packages/slwdc/nic-parser) [![License](https://camo.githubusercontent.com/438844b46f8f346d25d3fe1e994521d0202cb7d4d84c4257905a68ba61487993/68747470733a2f2f706f7365722e707567782e6f72672f736c7764632f6e69632d7061727365722f6c6963656e7365)](https://packagist.org/packages/slwdc/nic-parser) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/55f0d8b73b0b3d48742c677fc91ef5d36251f62f53c60c40ffb2933e8ae6392c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736c7764632f4e49435061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/slwdc/NICParser/?branch=master) [![Build Status](https://camo.githubusercontent.com/bb9e25197018039800a394261288ebdccf84e3d49e4586f84468aff897d1c774/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736c7764632f4e49435061727365722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/slwdc/NICParser/build-status/master) [![codecov](https://camo.githubusercontent.com/7c874c67bca0b661e5cd86b035ab16515ec8a0c9a21b9292c80df4a6f5950afd/68747470733a2f2f636f6465636f762e696f2f67682f736c7764632f4e49435061727365722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/slwdc/NICParser) [![SensioLabsInsight](https://camo.githubusercontent.com/40deae4ca1ae9b86aacadec09349dafa79f34e3ef00338af68d4e46d943144c3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32653631633565312d303935622d343363352d396661322d6337373532373438303737342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/2e61c5e1-095b-43c5-9fa2-c77527480774) [![CI](https://github.com/slwdc/NICParser/workflows/CI/badge.svg)](https://github.com/slwdc/NICParser/workflows/CI/badge.svg) [![Too many badges](https://camo.githubusercontent.com/aadaf5fc1f58bb564077e5397e6ae97055ed8d0dff536fd6ebac145ebb50d422/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374796c652d746f6f5f6d616e792d627269676874677265656e2e7376673f7374796c653d746f6f6d616e79266c6162656c3d626164676573)](https://github.com/slwdc/NICParser)

### Installation

[](#installation)

You can install the library easily with composer. Requires PHP 7.4 or later.

` composer require slwdc/nic-parser`

Alternaely, you can download the library from github, and manually include the class or integrate into your own autoloader. See the included `composer.json` file for `PSR-4` namespace mappings.

### Usage

[](#usage)

See the [Wikipedia article](https://en.wikipedia.org/wiki/National_identity_card_%28Sri_Lanka%29) for the formats used.

#### Parsing an ID number

[](#parsing-an-id-number)

```
