PHP code example of multiservicios-web / valida-curp

1. Go to this page and download the library: Download multiservicios-web/valida-curp 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/ */

    

multiservicios-web / valida-curp example snippets



MultiserviciosWeb\ValidaCurp\Client as ValidaCurp;
use MultiserviciosWeb\ValidaCurp\ValidaCurpException;

$validaCurp = new ValidaCurp("YOUR-TOKEN");

$validaCurp->setVersion(1); //1 or 2

$validaCurp->isValid('PXNE660720HMCXTN06');

$validaCurp->getData('PXNE660720HMCXTN06');

$validaCurp->calculate([
    'names' => 'Enrique',
    'lastName' => 'Peña',
    'secondLastName' => 'Nieto',
    'birthDay' => '20',
    'birthMonth' => '07',
    'birthYear' => '1966',
    'gender' => 'H',
    'entity' => '15',
]);

$validaCurp->getEntities();