PHP code example of tesla-software / oib

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

    

tesla-software / oib example snippets


use Tesla\OIB\OIB;

// Check if OIB is valid
OIB::validate('00000000001'); // Returns: bool
 php
// Check if OIB's are valid
OIB::validateMany('00000000001', '00000000002', ...); // Returns: array
// or
OIB::validateMany(['00000000001', '00000000002', ...]); // Returns: array

/**
 * Results
 *
    [
      "73963178454"   => false
      "25878484848"   => false
      "73963178454AA" => false
      "25878484848ZZ" => false
      "87783564545"   => false
      "87783564545GG" => false
      "12345678911"   => true
      "91145678919"   => true
      "87884784457"   => true
      "87871118443"   => true
      "36875454458"   => true
      "78745548455"   => true
    ]
*/