Project

General

Profile

Actions

Evolution #403

closed

export : convert html to plain text to enhanced lisibility

Added by Simon over 10 years ago. Updated about 10 years ago.

Status:
Fermé
Priority:
Normal
Assignee:
Category:
admin
Target version:
Start date:
07/29/2014
Due date:
% Done:

100%

Estimated time:
2.00 h
Resolution:

Description

export : convert html to plain text to enhanced lisibility

See class : http://www.chuggnutt.com/html2text (also in attached file)
http://www.chuggnutt.com/html2text-source

<?php

// Include the class definition file.
require_once(class.html2text.inc);

// The “source” HTML you want to convert.
$html = Sample string with HTML code in it;

// Instantiate a new instance of the class. Passing the string
// variable automatically loads the HTML for you.
$h2t =& new html2text($html);

// 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();

?>


Files

class.html2text.zip (5.02 KB) class.html2text.zip Simon, 07/29/2014 12:24 PM
Actions

Also available in: Atom PDF