diff --git a/php-iban.php b/php-iban.php index 278e05d..a7fdca8 100644 --- a/php-iban.php +++ b/php-iban.php @@ -63,12 +63,7 @@ function iban_to_human_format($iban) { # Remove all spaces $iban = str_replace(' ','',$iban); # Add spaces every four characters - $human_iban = ''; - for($i=0;$i0) && (($i+1)%4==0)) { $human_iban .= ' '; } - } - return rtrim($human_iban); + return wordwrap($iban,4,' ',true); } # Get the country part from an IBAN