Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alceanicu authored Aug 10, 2019
1 parent 7a2e9cd commit 2082c8d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ use alcea\cnp\Cnp;

$cnpToBeValidated = '5110102441483';

echo "CNP {$cnpToValidate} is " . Cnp::validate($cnpToValidate) ? 'valid' : 'invalid';

// OR

$cnp = new Cnp($cnpToBeValidated);
if ($cnp->isValid()) {
// get info from CNP
// extract information from CNP
echo "CNP {$cnpToBeValidated} - is valid" . PHP_EOL;
echo "Birth Date: {$cnp->getBirthDateFromCNP('Y/m/d')}" . PHP_EOL;
echo "Birth Place: {$cnp->getBirthCountyFromCNP()}" . PHP_EOL;
Expand All @@ -41,10 +45,6 @@ if ($cnp->isValid()) {
} else {
echo "CNP {$cnpToBeValidated} is invalid" . PHP_EOL;
}

// OR

echo "CNP {$cnpToValidate} is " . Cnp::validate($cnpToValidate) ? 'valid' : 'invalid';
```

## How to run tests?
Expand Down

0 comments on commit 2082c8d

Please sign in to comment.