a::xml($array, $tag = 'root', $head = true, $charset = 'utf-8', $tab = ' ', $level = 0)

Converts an array to a XML string

  • $array (array)
    The source array
  • $tag (string)
    The name of the root element
  • $head (boolean)
    Include the xml declaration head or not
  • $charset (string)
    The charset, which should be used for the header
  • $level (int)
    The indendation level
  • return (string)
    The XML string


$array = array(
 'cat'  => 'miao',
 'dog'  => 'wuff',
 'bird' => 'tweet'

echo a::xml($array, 'animals');



Is something missing or incorrect? Edit this page on Github…