DOMXML in PHP4 vs PHP5 Snafu
The project I've been working on has been relatively easy except when it came to writing some XML parsing code.
The problem was that the front page of the website was flash-based. The flash code needed to have access to the database in order to render a series of images representing the latest news items. I decided on writing a drupal module that would read the database and create an xml file the flash could read. It was a pretty simple affair and all was working well until I migrated from my development environment to staging. I had been developing on a dev box running PHP5, the staging server was running PHP4.4.2 and, lo and behold, the API for the DOMXML extension had been totally re-written. I was surprised they hadn't done any mapping of the API to allow legacy code that used the 4.4.2 DOMXML to work in PHP5. It wasn't like the API had changed dramatically for my needs either. Here's an example:
Here's the original PHP4 code:
//create the dom document.
$dom = domxml_new_doc("1.0");
$root = $dom->create_element("entries");
$dom->append_child($root);
//insert the date and time.
$date_attr = $dom->create_attribute('date',date("m/d/Y-H:i"));
$root->append_child($date_attr);
And the new PHP5 code:
//create the dom document.
$dom = new DOMDocument('1.0');
$root = $dom->createElement("entries");
$dom->appendChild($root);
//insert the date and time.
$date_attr = $root->setAttribute('date',date("m/d/Y-H:i"));

Thanks for sharing this
Thanks for sharing this information. I really like your way of expressing the opinions and sharing the information. It is good to move as chance bring new things in life, paves the way for advancement, etc. But it is well known to everyone that moving to new location with bulk of goods is not an easy task to move or shift from one place to other place because I have experienced about that and I face the problem like that. There I go to village near to my city faced that problem there.
1z0-007 dumps
EC0-349 dumps
70-681 dumps
642-974 dumps
PgMP dumps
642-447 dumps
JN0-101 dumps
PW0-104 dumps