简体   繁体   中英

How can I get an XML attribute as below using file_get_contents or simplexml_load_file?

How can I get the firstname of the XML below?

I am trying to use file_get_contents or simplexml_load_file and trying to echo the value like

$html->result[0]->contact;

without any luck. Can I have some help please?

在此处输入图片说明

I don't see full xml but I suppose it is:

$html->entities[0]->organization[0]->description;
$html->entities[0]->organization[0]->contacts[0]->contactPerson['firstName'];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM