class XML {
function create($arr, $print = false, $header = true) {
$result = "
\n";
foreach ($arr as $container) {
$result .= "\t- \n";
foreach ($container as $tag => $value) {
$result .= "\t\t<" . $tag . ">" . htmlspecialchars($value) . "" . $tag . ">\n";
}
$result .= "\t
\n";
}
$result .= "";
if ($print || $print == 1) {
if ($header || $header = 1) {
$result = "\n" . $result;
header("content-type: text/xml");
}
print$result;
} else {
return $result;
}
}
}
?>