How to Construct xml in php with Special Characters?

后端 未结 2 413
南笙
南笙 2021-01-23 09:42

My user enters message with special characters as follows:

this is a test of &&, &&, % as well as \'\' "", &         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-23 10:26

    You can use DOMDocument to create xml document and append required elements and text. All characters like & will be converted to & etc.

提交回复
热议问题