You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$address_formatter['ADMIN_AREA'] = 'Zuid Holland';
$address_formatter['LOCALITY'] = 'Rotterdam'
$address_formatter['POSTAL_CODE'] = '1234AL;
$address_formatter['STREET_ADDRESS'] = 'Highstreet 1337';
$address_formatter['COUNTRY'] = 'Netherlands';
$address_formatter['RECIPIENT'] = '';
$address_formatter['ORGANIZATION'] = '';
//Get the address in localised format
$html = true; // Optional - return the address in HTML <br> instead of \n new lines
$address = $address_formatter->formatAddress($html);
The it returns
<br>Highstreet 1337
<br>1234AL Rotterdam
But the first <br> is not needed, because we don't have a recipient and or organisation.
I have worked around this by adding added $address = trim($address, '<br>'); to my own code because I know I never have something prepended, but it might not be a solid solution know that I think about it.
So the PR, might also not be waterproof if the Locale changes.
Kind regrads,
Jaime!
The text was updated successfully, but these errors were encountered:
jmslbam
added a commit
to jmslbam/address-format
that referenced
this issue
Sep 15, 2024
So if `RECIPIENT` or `ORGANIZATION` are not filled or empty, then this results in only a `STREET_ADDRESS` that's prefix with an `%n` which will be replace by a `<br>` which results in an address that's starts a line lower then needed.
Fixesadamlc#23
E.g
The it returns
But the first
<br>
is not needed, because we don't have a recipient and or organisation.I have worked around this by adding added
$address = trim($address, '<br>');
to my own code because I know I never have something prepended, but it might not be a solid solution know that I think about it.So the PR, might also not be waterproof if the Locale changes.
Kind regrads,
Jaime!
The text was updated successfully, but these errors were encountered: