On Thu, January 19, 2006 12:08 pm, Ron Eggler (Paykiosks) wrote: > <cardSKU category="Local Dial Tone/Telephone Service" > distributor="EWI" > discontinued="false" cardtype="PIN" transactionType="PURC"> . . . > </cardSKU> > [/xml] > > and I wanna read information out of it by: > [php] > $xml = simplexml_load_string($data); > /* a few other things like parsing xml that works fine */ > foreach ($xml->cardSKU as $cardSKU) > { > array_push($category,(string)$cardSKU['category']); > } > [/php] > but it seems not to work, the array $category stays empty, why that? It's pretty much the same problem you posted yesterday... category is going to be the $key of the array, not the value. echo "<pre>xml->cardSKU:<br />\n"; var_dump($xml->cardSKU); echo "<hr />\n"; foreach($xml->cardSKU as $key => $cardSKU){ echo "key: $key<br />\n" var_dump($cardSKU); echo "<hr />\n"; } When you don't get the data you expect, use var_dump() on the data BEFORE that to see where the bits you want exist -- You'll usually find that they array/key/value/object structure has what you want, just in different places than you were looking. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php