AdmiralAkbar Posted April 19, 2011 Share Posted April 19, 2011 I just finished (or so I thought) a project. But my client's server runs PHP4, so I need to adapt my code. Here's what stopped working: $localClasses = new DOMDocument; $localClasses -> load("file.xml"); $localClasses -> get_elements_by_tagname('Title') -> item(0) -> firstChild -> nodeValue Here's my petty attempt at trying to adapt this code to run in PHP4: $file = file_get_contents("localClasses.xml"); $localClasses = new DOMDocument($file); $test = $localClasses -> get_elements_by_tagname('Title'); $testText = $test -> item[0] -> firstChild -> nodeValue; print $testText; This doesn't give me any errors, but nothing shows up. Any help would be appreciated. Thanks for reading! Quote Link to comment https://forums.phpfreaks.com/topic/234112-domdocument-from-php5-to-php4/ Share on other sites More sharing options...
kenrbnsn Posted April 19, 2011 Share Posted April 19, 2011 No host in their right mind should be running PHP4 anymore. Either convince your client to move to another host -- one that is running PHP5, or get your client to have his host upgrade to PHP5. Ken Quote Link to comment https://forums.phpfreaks.com/topic/234112-domdocument-from-php5-to-php4/#findComment-1203328 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.