3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://stackoverflow.com/questions/7994340/how-can-i-get-image-from-url-in-php-or-jquery-or-in-both'; $data = file_get_contents($url); $dom = new DOMDocument; $dom->loadHTML($data); $img = $dom->getElementsByTagName('img'); foreach($img as $x){ echo $x->src; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for stackoverflow.com failed: System error in /in/pG4hc on line 3 Warning: file_get_contents(http://stackoverflow.com/questions/7994340/how-can-i-get-image-from-url-in-php-or-jquery-or-in-both): Failed to open stream: php_network_getaddresses: getaddrinfo for stackoverflow.com failed: System error in /in/pG4hc on line 3 Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /in/pG4hc:6 Stack trace: #0 /in/pG4hc(6): DOMDocument->loadHTML('') #1 {main} thrown in /in/pG4hc on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.32 ms | 402 KiB | 8 Q