<?php
/*
* changed : 13. apr. 03
* author : troels@kyberfabrikken.dk
* download: http://www.phpclasses.org/browse.html/package/1020.html
*
* description :
* demo of class htmlcleaner
* this example opens a file named $filename in the current dir,
* processes it and saves the contents
* disclaimer :
* this piece of code is freely usable by anyone. if it makes your life better,
* remeber me in your eveningprayer. if it makes your life worse, try doing it any
* better yourself.
*/
require_once('htmlcleaner.php');
if (!isset($filename))
$filename = 'name_of_file.html';
$content = join ('', file ($filename));
$content_cleaned = htmlcleaner::cleanup($content);
$fp = fopen ($filename, 'w');
fwrite ($fp, $content_cleaned);
fclose($fp);
?>
|