@ XML elemanları öznitelik

1 Cevap

İşte benim XML:

["link"]=>
          array(2) {
            [0]=>
            object(SimpleXMLElement)#244 (1) {
              ["@attributes"]=>
              array(3) {
                ["type"]=>
                string(9) "text/html"
                ["href"]=>
                string(48) "http://twitter.com/ddd/statuses/1226112723"
                ["rel"]=>
                string(9) "alternate"
              }
            }
            [1]=>
            object(SimpleXMLElement)#245 (1) {
              ["@attributes"]=>
              array(3) {
                ["type"]=>
                string(9) "image/png"
                ["href"]=>
                string(59) "http://a3.twimg.com/profile_images/226345673/ddd_normal.png"
                ["rel"]=>
                string(5) "image"
              }
            }
          }
          ["author"]=>
          object(SimpleXMLElement)#246 (2) {
            ["name"]=>
            string(14) "ddd"
            ["uri"]=>
            string(16) "http://ddd.co.uk"
          }

Yukarıdaki XML daha büyük bir dizinin parçası, ama nasıl ben alabilirim

href ->          ["href"]=>
                    string(59) "http://a3.twimg.com/profile_images/226345673/ddd_normal.png"

PHP echo Eleman?

Bu (Ben biliyorum Yanlış) çalıştı nedir

 foreach ($entry->link as $img) {
            echo $img->href;
            echo "<img src='". $img ."' />";
           }