I have a semicolon delimited list that is exported to a csv file using fwrite and the shipping data is causing me some issues. The raw data in question looks like
Shipping (Interlink Express ( 20.88))
but this obviously breaks the layout due to the semicolon in the html entity. I thought I could fix this by replacing
$xml_orders .= $method.";";
with
$xml_orders .= html_entity_decode($method).";";
but that now gives me
Shipping (Interlink Express (€20.88))
I did try to html_entity_decode and then utf8_decode afterwards as I had previously used utf8_decode to fix a problem where ñ was being output as ñ, but that didn't fix the issue.
What is the best solution to this?
html_entity_decodeusing the 3rd parameter : see php.net/manual/fr/function.html-entity-decode.phpfputcsv.