3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument('1.0', 'UTF-8'); $teamName = 'RC Drachten'; // Ignore warnings. libxml_use_internal_errors(true); // load the string into the DOM (this is your page's HTML), see below for more info $doc->loadHTMLFile ('http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816'); // since we are working with HTML fragments here, remove <!DOCTYPE $doc->removeChild($doc->firstChild); // remove <html></html> and any junk $table = $doc->getElementsByTagName('table'); //$doc->replaceChild($body->item(0), $doc->firstChild); // echo the HTML (or desired portion thereof) $schedule = $doc->saveXML($table->item(1)); // Seperate each team $teams = explode ('</tr>',$schedule); echo $teams[0]; // Html table echo $teams[2]; // Table header for ($i = 0;$i<count($teams);$i++) { // Check if this is the right team $pos = strpos($teams[$i],$teamName); if ($pos !== false) { echo $teams[$i]; } } ?>
Output for 7.0.0 - 7.0.3, 7.0.5 - 7.1.0
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/hsDlk on line 8 Warning: DOMDocument::loadHTMLFile(http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/hsDlk on line 8 Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given in /in/hsDlk:11 Stack trace: #0 /in/hsDlk(11): DOMNode->removeChild(NULL) #1 {main} thrown in /in/hsDlk on line 11
Process exited with code 255.
Output for 7.0.4
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: System error in /in/hsDlk on line 8 Warning: DOMDocument::loadHTMLFile(http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/hsDlk on line 8 Fatal error: Uncaught TypeError: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given in /in/hsDlk:11 Stack trace: #0 /in/hsDlk(11): DOMNode->removeChild(NULL) #1 {main} thrown in /in/hsDlk on line 11
Process exited with code 255.
Output for 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/hsDlk on line 8 Warning: DOMDocument::loadHTMLFile(http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/hsDlk on line 8 Catchable fatal error: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given in /in/hsDlk on line 11
Process exited with code 255.
Output for 5.2.6 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: System error in /in/hsDlk on line 8 Warning: DOMDocument::loadHTMLFile(http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/hsDlk on line 8 Catchable fatal error: Argument 1 passed to DOMNode::removeChild() must be an instance of DOMNode, null given in /in/hsDlk on line 11
Process exited with code 255.
Output for 5.1.0 - 5.2.5
Warning: DOMDocument::loadHTMLFile(): php_network_getaddresses: getaddrinfo failed: System error in /in/hsDlk on line 8 Warning: DOMDocument::loadHTMLFile(http://www.resultservices.nl/rugby/overview.php?Page=SENIOR&LevelID=5&CompID=816): failed to open stream: Connection refused in /in/hsDlk on line 8 Warning: DOMNode::removeChild() expects parameter 1 to be DOMNode, null given in /in/hsDlk on line 11 <?xml version="1.0" encoding="UTF-8"?> Notice: Undefined offset: 2 in /in/hsDlk on line 21
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function libxml_use_internal_errors() in /in/hsDlk on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/hsDlk on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/hsDlk on line 2