All pastes #594480 Raw Edit

Something

public text v1 · immutable
#594480 ·published 2007-06-28 23:31 UTC
rendered paste body
function RecurseXML($xml,$parent="")
{
   $child_count = 0;
   foreach($xml as $key=>$value){
      $child_count++;     
      if(RecurseXML($value,$parent.".".$key) == 0)  // no childern, aka "leaf node"
      {
	      if ($parent==".Tournament"){
         	//print($parent . "." . (string)$key . " = " . (string)$value . "<BR>\n");  
         	//print((string)$key . " = " . (string)$value . "<BR>\n");      
$sql.="{$key}='{$value}'";
        	
	      }
      }     
   }
   //echo $sql;
   return $return;
}
$xml = simplexml_load_file('test2.xml');
$test = RecurseXML($xml);
echo $test;