mirror of
https://github.com/friendica/friendica
synced 2025-04-23 19:10:13 +00:00
Some code cleaning, changes to the xml generation
This commit is contained in:
parent
c9100e1102
commit
3e299aa7bf
2 changed files with 114 additions and 79 deletions
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
*/
|
||||
class xml {
|
||||
function from_array($array, &$xml) {
|
||||
function from_array($array, &$xml, $remove_header = false) {
|
||||
|
||||
if (!is_object($xml)) {
|
||||
foreach($array as $key => $value) {
|
||||
|
@ -14,7 +14,13 @@ class xml {
|
|||
$dom = dom_import_simplexml($root)->ownerDocument;
|
||||
$dom->formatOutput = true;
|
||||
$xml = $dom;
|
||||
return $dom->saveXML();
|
||||
|
||||
$xml_text = $dom->saveXML();
|
||||
|
||||
if ($remove_header)
|
||||
$xml_text = trim(substr($xml_text, 21));
|
||||
|
||||
return $xml_text;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue