Jump to content

array formatting issue


blacknight

Recommended Posts

im using the code

 

$ch = curl_init();
			$timeout = 30; // set to zero for no timeout
			$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
			curl_setopt ($ch, CURLOPT_URL, $url);
			curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
			curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
			$f = curl_exec($ch);
			curl_close($ch);			

		$xml = simplexml_load_string($f, 'SimpleXMLElement', LIBXML_NOCDATA);

 

to pull xml data from a website and the array im getting has @attributes as a key header.. like this

SimpleXMLElement Object
(
    [@attributes] => Array
        (
            [categoryId] => 92
            [dateCompleted] => 2009-02-12-07:00
            [desc] => Sample 50 different kinds of Azeroth's delectable dishes.
            [icon] => inv_misc_food_115_condorsoup
            [id] => 1832
            [points] => 10
            [title] => Tastes Like Chicken
        )

    [criteria] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [maxQuantity] => 50
                    [quantity] => 53
                )

        )

)

 

and i cant get this data out of the array i have tryed everything but nothing is working ... any one have any ideas...

Link to comment
https://forums.phpfreaks.com/topic/148691-array-formatting-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.