3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = "http://www.margonem.pl/?task=clanrank&w=infinity"; $xml = new DOMDocument(); $xml->validateOnParse = true; $xml->loadHTML(file_get_contents($html)); $xpath = new DOMXPath($xml); $table =$xpath->query("//*[@id='ranking']")->item(0); $rows = $table->getElementsByTagName("tr"); foreach ($rows as $row) { $cells = $row -> getElementsByTagName('td'); foreach ($cells as $cell) { print $cell->nodeValue; } }

preferences:
47.62 ms | 402 KiB | 5 Q