How to remove ANSI-Code (“
”) from string in PHP
问题 I have tried a lot but nothing is working. I want to import a XML-file with PHP. In some strings the customer puts some ANSI-Code Carrier Returns ("
"). I have tried to remove them with: str_replace('\r', '', $xml->description); I also tried it with "&\#13;" , "\r\n" , "\&\\#13\;" in the search but nothing works. Do you have any idea how to remove these linebreaks? Thanks! 回答1: Since your XML processor is already handling de-entitying the entities, you'll be left over with plain ASCII \n or