PHP code example of patrickjunod / avs-checker

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

    

patrickjunod / avs-checker example snippets


use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = new AvsChecker('756.3026.0705.92');
$avsNumber->isValid();
// Return true if it's a valid AVS Number, false if not

use PatrickJunod\AvsChecker\Facades\AvsChecker;

$avsNumber = AvsChecker::isValid('756.3026.0705.92');
// Return true if it's a valid AVS Number, false if not

use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid('7563026070592', false);
// Return true

use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid(['7563026070592', '756.2036.0705.92', 'AAA'], false);
// Return an array:
[
  0 => [
    "number" => "7563026070592",
    "isValid" => true
  ],
  1 => [
    "number" => "756.2036.0705.92",
    "isValid" => true
  ],
  2 => [
    "number" => "AAA",
    "isValid" => false
  ]
]