Hi People,

I'm trying to parse a xml file which has the following structure using simplexml_load_file:

<ytvideo>
<id>aaA77NlpI1I</id>
<integerid>-638381392</integerid>
<title>Re: It&apos;s Jerrytime: The Strange Trip</title>
<description>Video Cam Direct Upload</description>
<tags>
<string>emmy</string>
<string>strange</string>
<string>zucker</string>
</tags>
<uploader>saintrambone</uploader>
<category>Entertainment</category>
<viewCount>253</viewCount>
<favoriteCount>0</favoriteCount>
<ratingCount>2</ratingCount>
<minRating>1</minRating>
<maxRating>5</maxRating>
<avgRating>4.5</avgRating>

<comments>
<ytcomment>
<id>8957FDA4963F5F64</id>
<integerid>-882801485</integerid>
<author>faze93</author>
<comment>he roles with a peice of **** krew
he dosent know ****
sdk is the one of the best graff krews around vancouver,
aswell as lca, rts, bys, ydk, and tks</comment>
<commentDate>2008-04-16 17:22:14.0 BRT</commentDate>
</ytcomment>
<ytcomment>
<id>39FDB594CDCDC136</id>
<integerid>336312037</integerid>
<author>minitize</author>
<comment>I love his style. Its so simple and looks awesome.</comment>
<commentDate>2008-02-13 13:08:59.0 BRST</commentDate>
</ytcomment>
<ytcomment>
<id>A77A5003E65B9048</id>
<integerid>177690935</integerid>
<author>AkelOneR</author>
<comment>tiggghtttt!</comment>
<commentDate>2008-02-12 18:32:10.0 BRST</commentDate>
</ytcomment>
</ytvideo>

I'm using the following code:


...

$xml = simplexml_load_file("amostra/$v.APIDATA.xml");

$titulo = $xml->xpath('/ytvideo/title'); ok
$idArquivo = $xml->xpath('/ytvideo/integerid'); ok
$description = $xml->xpath('/ytvideo/description'); ok
$category = $xml->xpath('/ytvideo/category'); ok

$comments = $xml->xpath('comments/ytcomment');

print_r($comments);

echo "<br>titulo: $titulo[0]<br>"; ok
echo "idArquivo: $idArquivo[0]<br>"; ok
echo "category: $category[0]<br>"; ok
echo "description: $description[0]"; ok
....

However I'm in doubt about how to parse what I've got by
$comments = $xml->xpath('comments/ytcomment');


The print_r($comments) returns
Array ( [0] => SimpleXMLElement Object ( [id] => 95F6B44F4D77F00E [integerid] => -772199745 [author] => xFalcon417x [comment] => oh nos! you found outs ! [commentDate] => 2008-02-25 20:00:09.0 BRT ) [1] => SimpleXMLElement Object ( [id] => 2764CBA934E1BD2A [integerid] => -846351560 [author] => xFalcon417x [comment] => hahaha yeah winter is pretty beat if you ask me... unless there is madddd snow lol. [commentDate] => 2008-06-06 21:35:18.0 BRT )

Is there any chance for me to transforme $comments into some kind of array like that

$comments[0][comments]...


Thks

Rhiegen