Me gustaría saber si lo está bien o falta agregar algo
Código PHP:
<?php
function filter($tofilter){
// General
$tofilter=str_replace("<","",$tofilter);
$tofilter=str_replace(">","",$tofilter);
$tofilter=str_replace("{","",$tofilter);
$tofilter=str_replace("}","",$tofilter);
$tofilter=str_replace("[","",$tofilter);
$tofilter=str_replace("]","",$tofilter);
$tofilter=str_replace("(","",$tofilter);
$tofilter=str_replace(")","",$tofilter);
$tofilter=str_replace("/","",$tofilter);
$tofilter=str_replace("\\","",$tofilter);
// PHP
$tofilter= str_replace("function" , "" , $tofilter);
$tofilter= str_replace("php" , "" , $tofilter);
$tofilter= str_replace("echo" , "" , $tofilter);
$tofilter= str_replace("print" , "" , $tofilter);
$tofilter= str_replace("return" , "" , $tofilter);
// HTML
$tofilter= str_replace("html" , "" , $tofilter);
$tofilter= str_replace("body" , "" , $tofilter);
$tofilter= str_replace("head" , "" , $tofilter);
// JS
$tofilter= str_replace("script" , "" , $tofilter);
// Ajax y Otros
$tofilter= str_replace("xml" , "" , $tofilter);
$tofilter= str_replace("version" , "" , $tofilter);
$tofilter= str_replace("encoding" , "" , $tofilter);
// CSS
$tofilter= str_replace("css" , "" , $tofilter);
return $tofilter;
}
echo filter('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
?>