3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php #header('Content-type:application/json;charset=utf-8'); $url = 'http://exotel.in/hacks/exotel-geo/iframe-index.php'; $data = array('mobile_number' => '7266788211'); // use key 'http' even if you send the request to https://... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); #var_dump($result); # Create a DOM parser object $dom = new DOMDocument(); @$dom->loadHTML($result); #$output = array(); # Iterate over all the <a> tags foreach($dom->getElementsByTagName('h2') as $link) { # Show the <a href> echo $link->nodeValue; echo "<br />"; } #var_dump($result); ?>
Output for 5.3.21 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19, 7.0.4, 7.0.20, 7.1.5 - 7.2.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/WgdkW on line 17 Warning: file_get_contents(http://exotel.in/hacks/exotel-geo/iframe-index.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/WgdkW on line 17
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 7.0.3, 7.0.5 - 7.0.6, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/WgdkW on line 17 Warning: file_get_contents(http://exotel.in/hacks/exotel-geo/iframe-index.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/WgdkW on line 17