Project

General

Profile

Actions

Evolution #403

closed

export : convert html to plain text to enhanced lisibility

Added by Simon over 9 years ago. Updated over 9 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 #1

Updated by Simon over 9 years ago

  • Target version set to 1.8
Actions #2

Updated by Simon over 9 years ago

  • Status changed from Nouveau to Fermé
  • % Done changed from 0 to 100

Applied in changeset linea21|r2533.

Actions #3

Updated by Simon over 9 years ago

Replaced by https://github.com/PHPMailer/PHPMailer/blob/master/extras/class.html2text.php

because the other one used deprecated PHP function, see r2552

Actions

Also available in: Atom PDF