note 30417 added to ref.domxml
| From: | sorn at dsl dot upc dot es | Date: | Mon, 17 Mar 2003 21:38:09 +0000 |
| Subject: | note 30417 added to ref.domxml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45428@lists.php.net to get a copy of this message | ||
When parsing "iso-8859-1" encoded XML files, use "utf8_decode" to recover node
contents (libxml uses "UTF-8" internal encoding, so conversion needed).
--- BEGIN: mydata.xml ---
<?xml version="1.0" encoding="iso-8859-1"?>
...
--- END: mydata.xml---
--- BEGIN: myparser.php ---
<?php
...
$domxml = domxml_open_file("mydata.xml"));
...
$content = utf8_decode(trim($node->content));
echo $content;
...
?>
--- END: myparser.php
-eof-
--
http://www.php.net/manual/en/ref.domxml.php
http://master.php.net/manage/user-notes.php?action=edit+30417
http://master.php.net/manage/user-notes.php?action=delete+30417
http://master.php.net/manage/user-notes.php?action=reject+30417