Get jsFiddle result iframe source code with php
<p>I have a jsFiddle that lives a happy life at <a href="https://fiddle.jshell.net/DelightedDoD/yu6nekv4/show/light/" rel="nofollow noreferrer">https://fiddle.jshell.net/DelightedDoD/yu6nekv4/show/light/</a></p>
<p>If I navigate to <code>view-source:https://fiddle.jshell.net/DelightedDoD/yu6nekv4/show/light/</code> I can view the full rendered source code for my fiddle.</p>
<p>I need to get this full rendered source code in a php script.</p>
<p>Here is what I've tried:</p>
<h3>file_get_contents():</h3>
<pre><code>$src = file_get_contents('https://fiddle.jshell.net/DelightedDoD/yu6nekv4/show/light/');
echo '&lt;textarea&gt;'.$src.'&lt;/textarea&gt;';
</code></pre>
<h3>curl:</h3>
<pre><code>$ch = curl_init('https://fiddle.jshell.net/DelightedDoD/yu6nekv4/show/light/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$content = curl_exec($ch);
curl_close($ch);
echo '&lt;textarea&gt;'.$content.'&lt;/textarea&gt;';
</code></pre>
<p>In both cases what I end up with is the <em>source code of the page that renders my fiddle's source code into an iFrame</em> <strong>not</strong> the <em>source code of my actual fiddle</em></p>
<p>To see the result, go to <a href="http://dodsoftware.com/shared-resources/php/jsfiddle-mobile-bs-frame.php" rel="nofollow noreferrer">http://dodsoftware.com/shared-resources/php/jsfiddle-mobile-bs-frame.php</a></p>
<h3>Is there some way, I can replicate the result I get with <code>view-source:</code> using PHP or at least get the value then send it to my php script?</h3>