XML

Convert XML to array


/**
* Converts XML to array
*
* @param unknown_type $url
* @param unknown_type $get_attributes
* @param unknown_type $priority
* @return unknown
*/
function xml2array($url, $get_attributes = 1, $priority = 'tag')
{
$contents = "";
if (!function_exists('xml_parser_create'))
{
return array ();
}
$parser = xml_parser_create('');
if (!($fp = @ fopen($url, 'rb')))
{
return array ();
}
while (!feof($fp))
{
$contents .= fread($fp, 8192);
}
fclose($fp);
xml_parser_set_option($pars