Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Why are you using curl? You can load the xml data easily using <a href="http://php.net/file_get_contents" rel="nofollow">file_get_contents()</a> function.</p> <p>Try this:</p> <pre><code>&lt;pre&gt; &lt;?php $xml = simplexml_load_string( file_get_contents('/blog/feed/'), 'SimpleXMLElement', LIBXML_NOCDATA ); print_r($xml); ?&gt; </code></pre> <p><strong>EDIT :</strong> Here's an alternate way using CURL (confirmed working)</p> <pre><code>&lt;?php // CURL HTTP Get Helper Function function CurlGet($fromUrl) { // create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, $fromUrl); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $output contains the output string $output = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); // Return Output return (!empty($output) ? $output : false); } // Get XML Data From RSS Feed $xml_str = CurlGet('http://www.digins.nl/blog/feed/'); // Check If We Have Data if ($xml_str) { // Load XML $xml = simplexml_load_string($xml_str, 'SimpleXMLElement', LIBXML_NOCDATA); // Debug echo '&lt;pre&gt;'; print_r($xml); echo '&lt;/pre&gt;'; } else { // Curl request failed } ?&gt; </code></pre> <hr> <p>This is the output I got when I tested it:</p> <pre><code>SimpleXMLElement Object ( [@attributes] =&gt; Array ( [version] =&gt; 2.0 ) [channel] =&gt; SimpleXMLElement Object ( [title] =&gt; Digins news [link] =&gt; http://www.digins.nl/blog [description] =&gt; Just another WordPress site [lastBuildDate] =&gt; Thu, 31 Oct 2013 10:24:25 +0000 [language] =&gt; en-US [generator] =&gt; http://wordpress.org/?v=3.7.1 [item] =&gt; Array ( [0] =&gt; SimpleXMLElement Object ( [title] =&gt; test3 [link] =&gt; http://www.digins.nl/blog/test3/ [comments] =&gt; http://www.digins.nl/blog/test3/#comments [pubDate] =&gt; Thu, 31 Oct 2013 10:24:25 +0000 [category] =&gt; Uncategorized [guid] =&gt; http://www.digins.nl/blog/?p=9 [description] =&gt; 3e bericht ) [1] =&gt; SimpleXMLElement Object ( [title] =&gt; hello world 2 [link] =&gt; http://www.digins.nl/blog/hello-world-2/ [comments] =&gt; http://www.digins.nl/blog/hello-world-2/#comments [pubDate] =&gt; Thu, 31 Oct 2013 10:07:35 +0000 [category] =&gt; Uncategorized [guid] =&gt; http://www.digins.nl/blog/?p=5 [description] =&gt; Dit is een test bericht ) [2] =&gt; SimpleXMLElement Object ( [title] =&gt; Hello world! [link] =&gt; http://www.digins.nl/blog/hello-world/ [comments] =&gt; http://www.digins.nl/blog/hello-world/#comments [pubDate] =&gt; Wed, 25 Sep 2013 21:25:08 +0000 [category] =&gt; Uncategorized [guid] =&gt; http://www.digins.nl/blog/?p=1 [description] =&gt; Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! ) ) ) ) </code></pre> <hr> <p>If my updated CURL method does not work, then there is an issue with your hosting provider... check with them, because it works fine when I run it from dev PC.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload