Posted on: 09/21/05 08:33pm
By: sammykrupa
Posted on: 09/21/05 09:13pm
By: sammykrupa
<?php // Include the class definition file. require_once('class.html2text.inc'); // The "source" HTML you want to convert, stored in a file. $filename = // Instantiate a new instance of the class. Passing the filename // followed by the "true" flag tells the class to find the HTML // in the specified file. Should work on remote files, too. $h2t =& new html2text($filename, true); // The HTML is likely full of relative links, so let's specify // an absolute source. $h2t->set_base_url('home/'); // Simply call the get_text() method for the class to convert // the HTML to the plain text. Store it into the variable. $text = $h2t->get_text(); // Or, alternatively, you can print it out directly: $h2t->print_text(); ?>
Posted on: 09/21/05 10:45pm
By: vadertech