PHP code example of backfron / cedula-ecuador

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

    

backfron / cedula-ecuador example snippets


use  \Backfron\CedulaEcuador\Cedula;

$cedula = new Cedula('1234567890');

/**
 * The isValid() method will return true if the CI
 * number is valid or false otherwise.
 */

if($cedula->isValid()) {
    echo "The number is valid";
} else {
    echo "The number is invalid";
}

use  \Backfron\CedulaEcuador\Cedula;

$cedula = new Cedula('1003495585');
$cedula->getProvince(); // Imbabura