DOMDocument Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
darkandlong
Forum Newbie
Posts: 1
Joined: Fri Aug 15, 2008 8:40 am

DOMDocument Problem

Post by darkandlong »

Hello,

Trying to use DOMDocument and the following fails to echo anything,

<?php

$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom->saveXML();

?>

Does this mean something is missing from my installation of PHP (5.2)?

Thanks.
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: DOMDocument Problem

Post by Zoxive »

Are you sure it doesnt echo out anything? did you view the source of the webpage.

(Right click view page source in firefox.. etc)

If still nothing then you should at least be getting some errors.

Try..

Code: Select all

<?php
 
error_reporting(E_ALL);
ini_set('display_errors',TRUE);
 
echo '<pre>';
$dom = new DOMDocument('1.0', 'iso-8859-1');
echo $dom->saveXML();
echo '</pre>';
 
Post Reply