这种编码类型的名称是什么?
如果将以下文本复制并粘贴到 html 页面中,
انوان
您将看到以下阿拉伯文本:
我的问题是:
这种包含数字和井号 (#) 符号的编码类型的名称是什么,以及如何在 PHP 中对其进行解码
If you copy and paste the following text in a html page,
انوان
you will the following Arabic text:
انوان
My question is:
What is the name of this type of encoding that include numbers and hash (#) sign, and how decode it in PHP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这些是... HTML 实体(或挑剔者的“数字字符引用”)。
尝试
html_entity_decode
。示例:(
如果字符串的形式为
ا...
,则需要应用html_entity_decode
两次。(我不知道codaddict的编辑是否有效。))These are... HTML entities (or "Numeric character references" for the nitpickers).
Try
html_entity_decode
.Example:
(If the string is in the form
ا...
you need to applyhtml_entity_decode
twice. (I don't know if codaddict's edit is valid.))这些字符称为 HTML 实体。基本上,它们是表示
&
等字符以及可能在 HTML 中具有含义的其他符号的更安全的方式。所有字符都有相应的 HTML 实体。您可以使用
html_entity_decode
These characters are known as HTML entities. Basically, they're a safer way of representing characters such as
&
and other symbols that might have meanings in HTML. All characters have a corresponding HTML entity.You can decode them in PHP by using
html_entity_decode
您可以使用convert_uudecode()函数进行解码。
You can use the convert_uudecode() function for decode.
使用正确的术语:
&
是一个实体引用,它引用名为amp 的实体。ا
是一个字符引用,它引用 Unicode 字符集中的字符 U+0627(十进制为 1575)。这两个引用都是字符引用,因为它们仅引用单个字符。但实体也可以不仅仅代表单个字符。
To use proper terminology:
&
is an entity reference that references the entity named amp.ا
is a character reference that references the character U+0627 (1575 in decimal) in the Unicode character set.Both references are character references as they only reference single characters. But entities can also represent more than just a single character.