略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: XMLWriter

2024-11-14

XMLWriter

add a noteadd a note

User Contributed Notes 2 notes

up
2
lingtalfi
6 years ago
The single quote predefined entity is not escaped.
The other predefined entities are but not the single quote, so you will have to do it yourself.

That's what you would expect:

Ampersand     &     &
Single Quote     '     '
Double Quote     "     "
Greater Than     >     >
Less Than     <     &lt;

That's what you get with \XmlWriter:

Ampersand     &     &amp;
Single Quote     '     '
Double Quote     "     &quot;
Greater Than     >     &gt;
Less Than     <     &lt;
up
2
Alexey Zakhlestin
14 years ago
important: XMLWriter expects UTF-8 data from you. It can output xml in various encodings, but input should be strictly utf-8!

官方地址:https://www.php.net/manual/en/book.xmlwriter.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3