Skip to content

Commit

Permalink
Use @d0d0's suggestion at #44 to simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Stanish committed Jan 28, 2016
1 parent 8c617fc commit d909512
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions php-iban.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;$i<strlen($iban);$i++) {
$human_iban .= substr($iban,$i,1);
if(($i>0) && (($i+1)%4==0)) { $human_iban .= ' '; }
}
return rtrim($human_iban);
return wordwrap($iban,4,' ',true);
}

# Get the country part from an IBAN
Expand Down

0 comments on commit d909512

Please sign in to comment.