Return to Snippet

Revision: 36734
at November 25, 2010 12:55 by digitalzoomstudio


Initial Code
function readXML($arg, $type)
{
		$i=0;		
		$xml = simplexml_load_file($arg);
				
		if($type=='main'){
		foreach($xml->children() as $child) {
		if($child->getName()=="item"){
		echo "<h3>" . $child->title . "</h3>";
		if($i==0)
		readXML('http://localhost/wordpress/?mode=xml&xmlfile=rotator.php&page=1', 'images');
		$i++;
		}
		}
		}
		if($type=='images'){
		$aux = '<div id="coinslider">';
		foreach($xml->children() as $child)
		{
			if($child->getName()=="item")
			{
			$aux = $aux . '<img src="' . $child->file . '"/>';
			}
			}
			$aux = $aux . '</div>';
			echo $aux;
			}
		}
			
readXML("http://localhost/wordpress/?mode=xml", "main");

Initial URL
http://digitalzoomstudio.net

Initial Description
You can use this code under MIT licence.

Initial Title
PHP XML HTML Backup for Flash

Initial Tags
php, backup, flash

Initial Language
PHP