<?php
// Create DOM from URL or file
include_once('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://battlelog.battlefield.com/bf4/de/platoons/members/7973599489869481496/');
$myDiv = $html->find('div'); // wherever your the div you're ending up with is
$children = $myDiv->children; // get an array of children
foreach ($children AS $child) {
$child->outertext = ''; // This removes the element, but MAY NOT remove it from the original $myDiv
}
echo $myDiv->innertext;
Warning: include_once(): open_basedir restriction in effect. File(simple_html_dom.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/BaF9o on line 4
Warning: include_once(simple_html_dom.php): Failed to open stream: Operation not permitted in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Uncaught Error: Call to undefined function file_get_html() in /in/BaF9o:7
Stack trace:
#0 {main}
thrown in /in/BaF9o on line 7
Process exited with code 255.
Output for 8.0.13
Warning: include_once(simple_html_dom.php): Failed to open stream: No such file or directory in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Uncaught Error: Call to undefined function file_get_html() in /in/BaF9o:7
Stack trace:
#0 {main}
thrown in /in/BaF9o on line 7
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.33
Warning: include_once(simple_html_dom.php): failed to open stream: No such file or directory in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Uncaught Error: Call to undefined function file_get_html() in /in/BaF9o:7
Stack trace:
#0 {main}
thrown in /in/BaF9o on line 7
Process exited with code 255.
Warning: include_once(): open_basedir restriction in effect. File(simple_html_dom.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/BaF9o on line 4
Warning: include_once(simple_html_dom.php): failed to open stream: Operation not permitted in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Uncaught Error: Call to undefined function file_get_html() in /in/BaF9o:7
Stack trace:
#0 {main}
thrown in /in/BaF9o on line 7
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Warning: include_once(): open_basedir restriction in effect. File(simple_html_dom.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/BaF9o on line 4
Warning: include_once(simple_html_dom.php): failed to open stream: Operation not permitted in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Call to undefined function file_get_html() in /in/BaF9o on line 7
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Warning: include_once(simple_html_dom.php): failed to open stream: No such file or directory in /in/BaF9o on line 4
Warning: include_once(): Failed opening 'simple_html_dom.php' for inclusion (include_path='.:') in /in/BaF9o on line 4
Fatal error: Call to undefined function file_get_html() in /in/BaF9o on line 7
Process exited with code 255.