HTML Cleaner

kleine Script welches die Steuerzeichen aus dem HTML Code entfernt.

download
<?
// Text einlesen
$editor_data = $_POST[ 'editor_data' ];
 
// Tags entfernen
$editor_data = strip_tags($editor_data, '<li>');
 
// bestimmte Zeichen austauschen
$map = array(
 '–' => '-',
 '„' => '"',
 '“' => '"',
);
$editor_data = strtr($editor_data,$map);
 
// Jede Zeile führende Leerstellen entfernen
if (!empty($editor_data)) {
	$feld = explode("
",$editor_data);
 
	$editor_data = "";
	foreach( $feld as $zeile)
		$editor_data .= trim($zeile," ")."";
}
?>
<html>
<head>
<style>
html, body {
 
} 
.header {
	height: 40px;
	border: 1px solid;
}
.footer {
	height: 20px;
	border: 1px solid;
}
.container {
 
	min-height: 200px;
}
.textarea {
    width:100%;
	height: 80%;
	background: lightgray;
	overflow: auto;
}
</style>
</head>
 
<body >
<div class="header" >
	<center><h1 style="margin: 0px;">Simple Content Cleaner V0.10</h1></center>
</div>
 
<div  class="container" >
		<form action="index.php" method="post">
			<p>
				<textarea class="textarea" id="myInput" name="editor_data" oninput="myFunction()" ><?php echo $editor_data; ?></textarea> 
			</p>
			<p>	
				<input type="submit" name="auswahl" value="convert" />
				<!--<input type="submit" name="" value="Abbrechen" />-->
				<button onclick="copy_Function()">copy text</button>
				<button onClick="clear_Function();">clear</button>
			</p>
		</form>
</div>
 
<div class="footer" >
	<center>(c) by Conny Henn 2019 - <a href="http://www.hennweb.de" target="_blank">www.HennWeb.de</a></center>
</div>
	</body>
<script>
function copy_Function() {
  /* Get the text field */
  var copyText = document.getElementById("myInput");
 
  /* Select the text field */
  copyText.select();
 
  /* Copy the text inside the text field */
  document.execCommand("copy");
 
  /* Alert the copied text */
  //alert("Copied the text: " + copyText.value);
} 
function clear_Function(){
     document.getElementById('myInput').value = "";
};
 
</script>
</html>