PHP Класс Ip\Internal\Text\Html2Text

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
convert ( $html, $partial = null ) : string Tries to convert the given HTML into a plain text format - best suited for e-mail display, etc.

Защищенные методы

Метод Описание
fix_newlines ( $text ) : string Unify newlines; in particular, \r\n becomes \n, and then \r becomes \n. This means that all newlines (Unix, Windows, Mac) all become \ns.
iterate_over_node ( $node )
next_child_name ( $node )
prev_child_name ( $node )

Описание методов

convert() публичный статический Метод

In particular, it tries to maintain the following features:

  • Links are maintained, with the 'href' copied over
  • Information in the <head> is lost
public static convert ( $html, $partial = null ) : string
Результат string the HTML converted, as best as possible, to text

fix_newlines() защищенный статический Метод

Unify newlines; in particular, \r\n becomes \n, and then \r becomes \n. This means that all newlines (Unix, Windows, Mac) all become \ns.
protected static fix_newlines ( $text ) : string
Результат string the fixed text

iterate_over_node() защищенный статический Метод

protected static iterate_over_node ( $node )

next_child_name() защищенный статический Метод

protected static next_child_name ( $node )

prev_child_name() защищенный статический Метод

protected static prev_child_name ( $node )