什么是 HTML 实体“ ”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5082253/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 06:53:34  来源:igfitidea点击:

What is HTML Entity '
'?

htmlxml

提问by ford

I'm generating an XML Document object via the DOMDocument class. In the process, some kind of whitespace within elements is being converted into 
. It's pretty difficult to search for this one since search engines treat this character as whitespace.

我正在通过 DOMDocument 类生成一个 XML Document 对象。在此过程中,元素中的某种空白被转换为
. 搜索此字符非常困难,因为搜索引擎将此字符视为空格。

How do I scrub this character out of my xml output, or at least replace it with a different, preferable whitespace character?

我如何从我的 xml 输出中清除这个字符,或者至少用一个不同的、更可取的空白字符替换它?

Thanks.

谢谢。

回答by BoltClock

ASCII code 13 corresponds to a carriage return (in PHP, it's "\r").

ASCII 码 13 对应于回车(在 PHP 中,它是"\r")。

回答by Michael Kay

You scrub this character out of your output by not putting it there in the first place. Look for the code that puts the carriage return in your XML, and delete it.

您可以通过不首先将其放在输出中来将该字符从输出中删除。查找将回车符放入 XML 的代码,然后将其删除。