From d9095128464007c41fe76b12ac2a7ffd0e14fb34 Mon Sep 17 00:00:00 2001 From: Walter Stanish Date: Thu, 28 Jan 2016 15:12:26 +0800 Subject: [PATCH] Use @D0d0's suggestion at #44 to simplify code --- php-iban.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) 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