You are here: Re: SimpleXML + name spaces « All PHP « IT news, forums, messages
Re: SimpleXML + name spaces

Posted by Janwillem Borleffs on 10/08/96 11:35

albanach@gmail.com wrote:
> This works fine, but I am unable to access the Id attribute in the
> opening District element, i.e. AB01 or AB02.
>
> Would anyone be able to suggest how I might get that value with
> simplexml?
>

foreach ($districts as $key => $value) {
echo "Id = ", $value->attributes(), "\n";
echo "Name = " . $value->Name . "\n";
echo "Region1 = " . $value->Association[0] . "\n";
echo "Region2 = " . $value->Association[1] . "\n";
echo "Region3 = " . $value->Association[2] . "\n";
}

See also:

http://www.php.net/manual/en/function.simplexml-element-attributes.php


JW

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация