PHP读取XML文件出有关问题
Jun 13, 2016 pm 01:34 PM
PHP读取XML文件出问题
截取片段:
$dom = new DOMDocument;
$dom -> load("Practice.xml"); //这一行出错
.....
.....
?>
错误提示:
Warning: DOMDocument::load() [domdocument.load]: Input is not proper UTF-8,
indicate encoding ! Bytes: ......
在Practice.xml文档中,我使用了encoding = "UTF-8",但是还是不能出现中文内容,不知道问题出哪儿了?
------解决方案--------------------
Practice.xml也要用UTF-8编码
------解决方案--------------------
Practice.xml 需要在保存时选择 utf-8 编码
------解决方案--------------------
不是要你把 php 文件保存为 utf-8 的
而是要你把 xml 文件保存为 utf-8 的
既然 xml 文件已经声明
如果内容不是 utf-8 的,当然会报错
你也可以修改 xml 的语言声明

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size

How to change title bar color on Windows 11?

How to enable or disable taskbar thumbnail previews on Windows 11

10 Ways to Adjust Brightness on Windows 11

Can I open an XML file using PowerPoint?

How to turn off private browsing authentication for iPhone in Safari?
