Re: Simple XML in PHP
| From: | DredWerks | Date: | Wed, 25 Mar 2009 03:12:21 +0000 |
| Subject: | Re: Simple XML in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290663@lists.php.net to get a copy of this message | ||
In this case "media" is a namespace, so is "live".
The XML should have some lines above the ones you posted defining those
namespaces.
Try something like this:
$simplexml = simplexml_load_string(...your entire xml...);
$url0 = $simplexml->xpath( '//media:content' );
$url = $url0[0]->attributes()->url;
$title = $simplexml->xpath( '//media:title' );
research simplexml, xpath, and namespaces.
Good Luck
--
View this message in context: http://www.nabble.com/Simple-XML-in-PHP-tp22690831p22694472.html
Sent from the PHP - General mailing list archive at Nabble.com.