Questions about this topic? Sign up to ask in the talk tab.
Projects:Overview
From NetSec
Revision as of 08:18, 27 December 2010 by TriciaNoonan (Talk | contribs) (moved Projects to Projects:Overview: Namespace change to allow for only trusted members and up to view/edit.)
Current Projects
XML Parser Class
<?PHP // Zach - [email protected] // Requires: PHP5, cURL, SimpleXML $a = new XMLParser('http://www.google.com/sitemap.xml') or die("Invalid XML Data"); class XMLParser { public $xmldata; private $url = ''; public function __construct($strURL = '') { $this->url = (strlen($strURL) ? $strURL : FALSE); $this->xmldata = ($this->url ? $this->getXML($this->url) : FALSE); return $this->xmldata; } public function getXML($xURL) { $ch = curl_init($xURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $localXML = simplexml_load_string(curl_exec($ch)); curl_close($ch); return $localXML; } }