U
U
unfapable2016-02-29 17:58:11
XML
unfapable, 2016-02-29 17:58:11

How to replace quotes-herringbones with character code in php?

The requirements for exporting news to rss for the Yandex News service say the following:

Characters < > & ' " occurring in the text must be replaced with the corresponding
elements:
...
Quotation marks-"Christmas trees" - character codes 171 and 187

My texts are printed by a typographer, so the quotation marks are Christmas trees. To replace quotes, I used the htmlentities function, but as a result, the xml output turned out to be incorrect:
Entity 'laquo' not defined
I.e. Christmas trees were replaced with laquo, and not with a character code (171 or 187). How can this be fixed?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question