$URL
";
$xml=http_get($URL);
//print "$xml";
$Results=xml2array($xml);
//print "
"; //print_r($Results); //print ""; foreach($Results[EventDetails][0][Event] as $Event){ print "
"; print_r($Event); print ""; } function http_get($URL){ $URL=str_replace("\"","%34",$URL); $URL=str_replace("\n","",$URL); return `/usr/bin/lynx -source "$URL"`; } function xml2array( $textXml ) { $regExElements = '/<(\w+)([^>]*)>(.*?)<\/\\1>/s'; $regExAttributes = '/(\w+)="([^"]*)"/'; preg_match_all( $regExElements, $textXml, $matchElements ); foreach ( $matchElements[1] as $keyElements=>$valElements ) { if ( $matchElements[2][$keyElements] ) { preg_match_all( $regExAttributes, $matchElements[2][$keyElements], $matchAttributes ); foreach ( $matchAttributes[0] as $keyAttributes=>$valAttributes ) { $arrayAttributes[ $valElements.' attributes' ][$matchAttributes[1][ $keyAttributes ] ] = $matchAttributes[2][ $keyAttributes ]; } } else { $arrayAttributes = null; } if ( preg_match( $regExElements, $matchElements[3][$keyElements]) ) { if ( $arrayAttributes ) { $arrayFinal[ $valElements ][ $valElements.' attributes' ] = $arrayAttributes[ $valElements.' attributes' ]; } $arrayFinal[ $valElements ][] = xml2array( $matchElements[3][$keyElements] ); } else { $arrayFinal[ $valElements ] = $matchElements[3][ $keyElements ]; $arrayFinal = array_merge( $arrayFinal, $arrayAttributes ); } } return $arrayFinal; } ?>