PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of the pop   CNP validator   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: How to use `CheckCNP` class
Class: CNP validator
Validate and extract details from a Romanian CNP
Author: By
Last change: # not important updates
Date: 11 years ago
Size: 653 bytes
 

Contents

Class file image Download
<?php

date_default_timezone_set
("Europe/Bucharest");

require
"class.cnp.php";

$a = new CNP("your cnp");

/*
 * Check if there are any error
 * Take a look inside class from what errors can be generated
 */
if ( ! $a->error) {
   
/*
     * First method means to get info about the possessor of CNP in one array
     */
   
echo "<pre>";
   
print_r($a->fetchAllData());
    echo
"</pre>";

   
/*
     * or second method, get specific information about the possessor of CNP
     *
     * CNP::getGenre()
     * CNP::getYear()
     * CNP::getDay()
     * CNP::getMonth()
     * CNP::getResidentInfo()
     * CNP::getStrangerInfo()
     */
}
else
    echo
$a->error;
?>