Strip HTML Tags
May 18th, 2005 by Intermanaut
Fairly self-explanatory. This example gets its input from a file called ‘filename’, strips the HTML markup and displays what’s left in the browser.
<?
$fp=fopen (“filename”,”r”);
$file=fread ($fp,filesize (“filename”));
$fclose($fp);
$pattern=”‘<[\/\!]*?[^<>]*?>’si”;
$replace=”";
$file = preg_replace ($pattern, $replace, $filev[$r]);
print “$file”;
?>