PHP code example of shapecode / iban-bundle

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

    

shapecode / iban-bundle example snippets

 php


// app/AppKernel.php
//...

class AppKernel extends Kernel
{
    //...
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Shapecode\Bundle\IbanBundle\ShapecodeIbanBundle(),
        );
        //...

        return $bundles;
    }
    //...
}
 php


// get iban from country code, bank identification and account number
$iban = $this->getContainer()->get('shapecode_iban.generator')->generateIban('DE', '50010517', '0648489890');

// get bic from iban
$bic = $this->getContainer()->get('shapecode_iban.generator')->generateBic($iban);

// validate iban
$isIban = $this->getContainer()->get('shapecode_iban.generator')->validateIban($iban);