note 75561 added to ref.simplexml
| From: | webmasteratmavoricdotnet at osu1 dot php dot net | Date: | Tue, 05 Jun 2007 15:26:26 +0000 |
| Subject: | note 75561 added to ref.simplexml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127233@lists.php.net to get a copy of this message | ||
If you are using the above examples to get at external XML/RSS files and are encountering errors,
you need to understand that PHP Version 5.2.3 + forbids the use of using include to get at external
XML/RSS files . You need to change the start of the code slightly...
<?php
$url = 'http://www.a_external_site.com/example.xml';
$rss_file = file_get_contents($url);
$xml = new SimpleXMLElement($rss_file);
echo $xml->movie[0]->plot; // "So this language. It's like..."
?>
Just replace the first two lines of the exsisting code with the first two of the above code.
----
Server IP: 194.145.210.3
Probable Submitter: 86.140.26.252
----
Manual Page -- http://www.php.net/manual/en/ref.simplexml.php
Edit -- https://master.php.net/note/edit/75561
Del: integrated -- https://master.php.net/note/delete/75561/integrated
Del: useless -- https://master.php.net/note/delete/75561/useless
Del: bad code -- https://master.php.net/note/delete/75561/bad+code
Del: spam -- https://master.php.net/note/delete/75561/spam
Del: non-english -- https://master.php.net/note/delete/75561/non-english
Del: in docs -- https://master.php.net/note/delete/75561/in+docs
Del: other reasons-- https://master.php.net/note/delete/75561
Reject -- https://master.php.net/note/reject/75561
Search -- https://master.php.net/manage/user-notes.php