<?php 

function piece_wise($iban_all_digits) {

    $remainder = NULL;
    $slice = 9;

    for ($i=0; $i<strlen($iban_all_digits); $i=$i+$slice)
    {
        if ($i>0)
        {
            $slice = 7;
        } 

        $part = $remainder . substr($iban_all_digits, $i, $slice);
        
        
        $remainder = intval($part) % 97;
    }

return $remainder;

}


$iban = ;


$iban = str_replace(' ', '', $iban); 


$iban_length = strlen($iban);
$country_code = substr($iban, 0, 2);


$lengths = ['GB' => 22];


if ($lengths[$country_code] != $iban_length) 
{ 
    exit ();
}



$iban = substr($iban, 4) . substr($iban, 0, 4);





$iban_arr = str_split($iban, 1);


$iban_all_digits = '';

foreach ($iban_arr as $key=>$value)
{
    if (ctype_alpha($value)) 
    {
        $value = ord($value) - 55;
    }
    $iban_all_digits = $iban_all_digits . $value;
}


if (piece_wise($iban_all_digits) === 1) 
{
    echo ;
}

else 
{
    echo ;
}