PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php function tdrows($elements) { $row_data = []; foreach ($elements as $element) { $value = $element->firstChild->nodeValue; if ($value) { $row_data[] = trim($value); } } return $row_data; } function getdata() { $contents = file_get_contents( "https://account.jamf.com/training-courses/jamf-200-course/all" ); $DOM = new DOMDocument(); $DOM->loadHTML($contents); $items = $DOM->getElementsByTagName("tr"); foreach ($items as $node) { $list[] = tdrows($node->childNodes); } return $list; } $result = getdata(); var_export($result);
Show:  
Copy Clear