PHP code example of evarmi / algorithm-validator

1. Go to this page and download the library: Download evarmi/algorithm-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/ */

    

evarmi / algorithm-validator example snippets


    ### Validación de DNI:

    $validacionDNI = Validator::documentValidation('23826295C');

    var_dump($validacionDNI);
    /**
     * [
     *      "type"=> "DNI" ,
     *      "value" => "23826295C",
     *      "result" => true
     * ]
     **/

    ### Validación de NIE:

    $validacionNIE = Validator::documentValidation('X8222827M');

    var_dump($validacionNIE);
    /**
     * [
     *      "type"=> "NIE" ,
     *      "value" => "X8222827M",
     *      "result" => true
     * ]
     **/

    ### Validación de CIF

    $validacionCIF = Validator::documentValidation('B86561412');

    var_dump($validacionCIF);
    /**
     * [
     *      "type"=> "CIF" ,
     *      "value" => "B86561412",
     *      "result" => true
     * ]
     **/


    ### Validación de IBAN
    $validacionIBAN = Validator::ibanValidation('ES7921000813610123456789');

    var_dump($validacionIBAN);
    /**
     * [
     *      "type"=> "IBAN" ,
     *      "value" => "ES7921000813610123456789",
     *      "result" => true
     * ]
     **/