Strange text when converting an XML array to XML

Im using the answer to this question to convert an XML array to a single XML output:

Output XML array to plain XML

Im using a simpler solution of the two (indicated as answer)

All this works for me, however at the beginning of the output I get:

string(109960) "

Can anyone shed some light on this?

+3
source share
2 answers

It looks like you are using an XML string to output: var_dump

var_dump($xml);

Instead of using : echo

echo $xml;


This explains:

  • Quotes around the entire XML string
  • string - type of variable passed as parameter var_dump
  • 109960 is the length of your string.

var_dump() ; , () , .

+2

, - var_dump (ed). var_dump, .

0

Source: https://habr.com/ru/post/1739345/


All Articles