Yes it works
I have another question :
My code generates a xml in this format:
<?xml version=1.0?>
<text>
<title></title>
<body></body>
<text>
i need to evolve to generate this format:
<?xml version=1.0?>
<text>
<titulo></titulo>
<body>
<paragraph></paragraph>
<paragraph></paragraph>
... (n paragraphs...)
</body>
<text>
Inside the variable: $txt_body
there is the tags:<p></p>
Wich is the best way to find then and generate the second format of xml above?
The part of the code is:
//array with data to xml
//inside $txt_body there are the <p></p> tags i need to find
$shows = array(array('title' => '.$txt_title.',
'body' => '.$txt_body.'),);
//start to write xml
$somecontent = "<?xml version=1.0?>\n";
foreach ($shows as $show) {
$somecontent .= " <text>\n";
//writes <title> and <body>
//need create inside <body></body> the tags :
//<paragraph></paragraph> how??
foreach($show as $tag => $data) {
$somecontent .= " \t<$tag>" . htmlspecialchars($data) . "</$tag>\n";
}
//$somecontent .=" </show>\n";
}
$somecontent .=" </text>\n";
Thank´s in advance and best regards!