From a5259b83e198f409a3a5f0a96f60f71f3ec17f09 Mon Sep 17 00:00:00 2001 From: Robert Sesek <rsesek@bluestatic.org> Date: Sat, 14 Jul 2007 22:48:54 +0000 Subject: [PATCH] Adding a few tests of PHP5's new features --- php520-test/SimpleXml.php | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 php520-test/SimpleXml.php diff --git a/php520-test/SimpleXml.php b/php520-test/SimpleXml.php new file mode 100644 index 0000000..2eebe1a --- /dev/null +++ b/php520-test/SimpleXml.php @@ -0,0 +1,52 @@ +<?php +/*=====================================================================*\ +|| ################################################################### +|| # Blue Static ISSO Framework +|| # Copyright ©2002-[#]year[#] Blue Static +|| # +|| # This program is free software; you can redistribute it and/or modify +|| # it under the terms of the GNU General Public License as published by +|| # the Free Software Foundation; version [#]gpl[#] of the License. +|| # +|| # This program is distributed in the hope that it will be useful, but +|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +|| # more details. +|| # +|| # You should have received a copy of the GNU General Public License along +|| # with this program; if not, write to the Free Software Foundation, Inc., +|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +|| ################################################################### +\*=====================================================================*/ + +header('Content-Type: text/html; charset=utf8'); + +// simple document +$data = file_get_contents('../docs/xmltest.xml'); +$xml = new SimpleXMLElement($data); +print_r($xml); +print_r($xml->download[1]->date->timestamp->attributes()); + +// utf8 - no header tag +$data = '<doc> + <moo>××××¢×ת ×©× ×¦×ר קשר ×× ××××¢×ת ×ש×× ×ק××</moo> +</doc>'; +$xml = new SimpleXmlElement($data); +print_r($xml); + +// utf8 +$data = '<?xml version="1.0" encoding="utf-8" ?> +<doc> + <moo>××××¢×ת ×©× ×¦×ר קשר ×× ××××¢×ת ×ש×× ×ק××</moo> +</doc>'; +$xml = new SimpleXmlElement($data); +print_r($xml); + + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file -- 2.43.5