Posted by ZeldorBlat on 04/16/07 13:27
On Apr 16, 6:32 am, Man-wai Chang <toylet.toy...@gmail.com> wrote:
> --
> iTech Consulting Services Limited
> Expert of ePOS solutions
> Website:http://www.itech.com.hk(IE only)
> Tel: (852)2325 3883 Fax: (852)2325 8288
This is untested. The element names will be the array's keys, and the
values will be the values. If the value is an array it will turn that
into XML and stick it inside the element.
function arrayToXML($a) {
$xml = '';
foreach($a as $k => $val)
$xml .= "<$k>" . (is_array($val) ? arrayToXML($val) : $val) .
"</$k>";
return $xml;
}
Navigation:
[Reply to this message]
|