PHP code example of filipac / cnp
1. Go to this page and download the library: Download filipac/cnp library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
filipac / cnp example snippets
use Filipac\Cnp\Cnp;
if(Cnp::valid('1930101021162')) #true
echo 'Cnp-ul este valid';
if(! Cnp::valid('1930101021161')) #false
echo 'Cnp-ul este invalid';
if(Cnp::invalid('1930101021161')) #true
echo 'Cnp-ul este invalid';
if(!Cnp::invalid('1930101021162')) #false
echo 'Cnp-ul este valid';
public function rules()
{
return [
'cnp' => '
Validator::make($data, [
'cnp' => '
app.php
tests/CnpTest.php