PHP Classes

File: htmlcleaner_demo_2.php

Recommend this page to a friend!
  Packages of troels knak-nielsen   htmlcleaner   htmlcleaner_demo_2.php   Download  
File: htmlcleaner_demo_2.php
Role: Example script
Content type: text/plain
Description: yet a demonstration of htmlcleaner
Class: htmlcleaner
Clean up MSHTML and Word HTML
Author: By
Last change:
Date: 23 years ago
Size: 843 bytes
 

 

Contents

Class file image Download
<?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);
?>