andresdzphp
gracias checandolo de la primero manera funciona bien pero de la segunda la mas simple me da error
Código PHP:
Ver originalWarning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: URL file-access is disabled in the server configuration in /home/public_html/dominio.com/yt.php on line 2
Warning: SimpleXMLElement::__construct(http://gdata.youtube.com/feeds/api/videos/osRddh2HSZI) [simplexmlelement.--construct]: failed to open stream: no suitable wrapper could be found in /home/public_html/dominio.com/yt.php on line 2
Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: I/O warning : failed to load external entity "http://gdata.youtube.com/feeds/api/videos/osRddh2HSZI" in /home/public_html/dominio.com/yt.php on line 2
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/public_html/dominio.com/yt.php:2 Stack trace: #0 /home/public_html/dominio.com/yt.php(2): SimpleXMLElement->__construct('http://gdata.yo...', 0, true) #1 {main} thrown in /home/public_html/dominio.com/yt.php on line 2
la linea 2 es esta
$sxe = new SimpleXMLElement('http://gdata.youtube.com/feeds/api/videos/osRddh2HSZI', null, true);