Why no SimpleXML?

software development


I was just wondering why a default extension in PHP like SimpleXML has been disabled? – It has no inherant security flaws and its just a staple everywhere else.



Did you run a check against the phpinfo() function on your site? Please verify what version of php got installed. As you know, it’s new as of version 5. I recently brought up a new subdomain using the default DH setup. Here’s details from my phpinfo.

Configure Command: '–with-xml’
DOM/XML: enabled
libXML support - active
libXML streams - enabled
Revision - $Revision: $
Schema support - enabled

If it’s not enabled for you, you might want to contact support.



// cURL grabs the blog feed and puts it into $blogContents as a string
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, “http://blog.yourdomain.com/feed.xml”);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$blogContents = curl_exec($ch);

// Done fetching feed, manipulate string
$xml = simplexml_load_string($blogContents);
$blog = $xml->channel;
$blogEntries = $blog->item;
echo ‘’ . $blogEntries->title . ‘

Works for me

Check out Gordaen’s Knowledge, the blog, and the MR2 page.