[Typo3-dev] t3lib_div::xml2array() and collections
Jerome
typo3dev at ameos.com
Wed Dec 14 10:51:41 CET 2005
Thanks Martin !
"Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> a écrit dans le
message de news:
mailman.1.1134549981.19352.typo3-dev at lists.netfielders.de...
> Jerome schrieb:
>> Hello,
>>
>> I'm using an XML file in my extension.
>> I use t3lib_div::xml2array() to get an array containing the structure of
>> the XML.
>>
>> But I have a problem : the function gets rid of my collections.
>> Ex:
>>
>> ----------------------------------
>>
>> $xml = "<root>
>> <sometag>hello</sometag>
>> <items>
>> <item>first item</item>
>> <item>second item</item>
>> <item>third item</item>
>> </items>
>> </root>";
>
> Use the attribute "index".
>
> $xml = '<root>
> <sometag>hello</sometag>
> <items>
> <item index="0">first item</item>
> <item index="1">second item</item>
> <item index="2">third item</item>
> </items>
> </root>';
>
> You can also use strings for the indices.
>
> Masi
More information about the TYPO3-dev
mailing list