European banking has moved to the IBAN format, replacing the local account numbers. As these new IBAN include not only the account but also country and bank code, their length makes it difficult to read and copy for humans. The recommended format is show them in groups of 4 digits. Using spaces is one way to show them on your website but when copied into the input field of many banks the last digits are cut as the number of digits is limited to the local definition.
Thus a better way to show them that allows to read them properly but copies without spaces is to apply smart formatting via SPAN. This short UDT does exactly that.
Code: Select all
if (isset($params['iban'])) {
$parts = str_split($params['iban'],4);
foreach ($parts as $part) {
echo '<span style="margin-right: 0.3em;">'.$part.'</span>';
}
} else {
echo "Parameter 'iban' missing!";
}