PHP code example of carloswph / valium-pt

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

    

carloswph / valium-pt example snippets


use Valium\PT\Nif;
use Valium\PT\Niss;
use Valium\PT\Iban;
use Valium\PT\Bi;

check([720014360, '291653170', 980547490, 281234500, 510837620]);
// Returns the type of tax payer for each valid number
$r = $nif->check([292679411, '720014360', 980547490, 281234500, 510837620], true);

var_dump($q);
var_dump($r);

$niss = new Niss();
// Returns a bool for each number in the array
$s = $niss->check([12060903799, 12073833086, 12060904475]);

var_dump($s);

$iban = new Iban();
// Returns a bool for each account in the array
$t = $iban->check(['PT50003300004549519501405', 'PT50001200004549519501405']);

var_dump($t);

$bi = new Bi();
// As an input, an array of the BI numbers together with the control digit (the first number before the two letters, XX, XY, i.e)
$x = $bi->check(['108015750', '34521320']);

var_dump($x);