"Simple HTML DOM Parser" how to remove tags?

Is the HTML code:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
span.cls_004{font-family:Arial,serif;font-size:18.1 px;color:rgb(255,255,255);font-weight:bold;font-style:normal;text-decoration: none}
-->
</style>
<script type="text/javascript" src="Utah motorcycleFactSheet2012_files/wz_jsgraphics.js"></script>


<div style="position:absolute;left:50%;margin-left:-306px;top:0px;width:612px;height:792px;border-style:outset;overflow:hidden">
<div style="position:absolute;left:0px;top:0px">
<img src="Utah motorcycleFactSheet2012_files/background1.jpg" width="612" height="792"></div>
<div style="position:absolute;left:29.88 px;top:32.86 px" class="cls_004"><span class="cls_004">2012 Utah Crash Facts</span></div>
</div>


From which to remove the following HTML tags:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="Utah motorcycleFactSheet2012_files/wz_jsgraphics.js"></script>




Here he began, and then not know what to do:
//if(isset($_POST['k1'])){}
 //$k1 = $_POST['k1'];
include('simple_html_dom.php');
 $html = new simple_html_dom();
$html->load('
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="Utah motorcycleFactSheet2012_files/wz_jsgraphics.js"></script>



');
 $element = $html->find("html");
 $element = null;
 echo $html->save();
September 26th 19 at 12:00
2 answers
September 26th 19 at 12:02
Solution
I'm just in the HTML code, removed the "style" (Reads the entire HTML of an element including itself) and "body" (Read inner HTML of the element).
include('simple_html_dom.php');
$html = new simple_html_dom();
$html = str_get_html($k1);

$style = $html->find('style',0);
echo $style->outertext;

$body = $html->find('body',0);
echo $body->innertext;
September 26th 19 at 12:04
isn't it easier just to pick body and take the insides?
Yes, it is easier. By this method and resolved the issue... Tomorrow will add your variant (turnkey solutions). - elva68 commented on September 26th 19 at 12:07

Find more questions by tags HTMLParsingPHPWeb Development