PHP code example of seisigmasrl / dgii-rnc-validator
1. Go to this page and download the library: Download seisigmasrl/dgii-rnc-validator 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/ */
seisigmasrl / dgii-rnc-validator example snippets
...
// 132620951 is a valid RNC
$validatedRnc = DgiiRncValidator::check("132620951");
var_dump($validatedRnc);
// array(4) {
// ["rnc"]=> string(9) "132620951"
// ["name"]=> string(29) "KOI CORPORATION BY SAIKOV SRL"
// ["commercial_name"]=> string(25) "KOI CORPORATION BY SAIKOV"
// ["status"]=> string(6) "Active"
// }
// 123456789 is an invalid RNC
$validatedRnc = DgiiRncValidator::check("123456789");
var_dump($validatedRnc); // bool(false)
...
// 132620951 is a valid RNC
$validatedRnc = DgiiRncValidator::validateRNC("132620951");
var_dump($validatedRnc); // bool(true)
// 123456789 is an invalid RNC
$validatedRnc = DgiiRncValidator::validateRNC("123456789");
var_dump($validatedRnc); // bool(false)
...
// 132620951 is a valid RNC
$rncType = DgiiRncValidator::rncType("132620951");
var_dump($rncType); // enum(Types::RNC)
// 123456789 is an invalid RNC
$rncType = DgiiRncValidator::rncType("04800009577");
var_dump($rncType); // enum(Types::CEDULA)