Re: Simple XML in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux