class Text

Methods

__construct()

No description

string
close_html_tags(string $text)

close unclosed html tags

string
convertToPlainText(string $mixedHtmlText)

Convert mixed text/html to text without entities and html This is NOT a replacement for XF->lib->sec

string
convert_to_utf8($string)

Converts the passed string to UTF8 (auto detects current encoding) Required mbstring PHP Support!

string
decode_from_imap_mime(string $mimeStr, string $inputCharset = 'utf-8', string $targetCharset = 'utf-8', string $fallbackCharset = 'iso-8859-1')

Deocodes the mime declaration in a string and returns a valid UTF-8 string.

array
getNormalizedLetters()

Returns a list of umlauts and accent letters with their corresponding normalized letters.

array
get_diff(string $from_text, string $to_text, string $split_mode = 'words')

No description

string
get_diff_render(string $from_text, string $to_text, string $display_changes = 'all', string $split_mode = 'words')

No description

array
get_hashtags(string $text_with_hashtags, bool $return_with_hash = false)

Extracts all hashtags in the given text and returns them as array

string
get_soundex(mixed $word)

Soundex "Like" based on Locale

string
htmlentities(mixed $text, mixed $encode_tags = true, string $text_encoding = 'UTF-8')

Convert all applicable characters to HTML entities

bool
is_html(string $string)

checks if the string contains any html tags and returns true if so

string
limit_string(string $string, int $charlimit)

Checks if the last character is or isnt a space. (does it the normal way if it is) It explodes the string into an array of seperate words, the effect is... it chops off anything after and including the last space.

Details

at line 19
__construct()

No description

at line 82
string close_html_tags(string $text)

close unclosed html tags

Parameters

string $text

The text to clean

Return Value

string

at line 440
string convertToPlainText(string $mixedHtmlText)

Convert mixed text/html to text without entities and html This is NOT a replacement for XF->lib->sec

Parameters

string $mixedHtmlText

Return Value

string

plain text

at line 57
string convert_to_utf8($string)

Converts the passed string to UTF8 (auto detects current encoding) Required mbstring PHP Support!

Parameters

$string

Return Value

string

UTF8 Encoded String

at line 387
string decode_from_imap_mime(string $mimeStr, string $inputCharset = 'utf-8', string $targetCharset = 'utf-8', string $fallbackCharset = 'iso-8859-1')

Deocodes the mime declaration in a string and returns a valid UTF-8 string.

Replaces the old imap_mime_header_decode functionality

Parameters

string $mimeStr

The string including the mime content

string $inputCharset
string $targetCharset
string $fallbackCharset

Return Value

string

The result string

at line 416
array getNormalizedLetters()

Returns a list of umlauts and accent letters with their corresponding normalized letters.

Return Value

array

at line 32
array get_diff(string $from_text, string $to_text, string $split_mode = 'words')

No description

Parameters

string $from_text

FROM Text (How was this source modified)

string $to_text

TO Text (Based on this new version)

string $split_mode

Return Value

array Differences

at line 45
string get_diff_render(string $from_text, string $to_text, string $display_changes = 'all', string $split_mode = 'words')

No description

Parameters

string $from_text

FROM Text (How was this source modified)

string $to_text

TO Text (Based on this new version)

string $display_changes

Changes [all, modified, copy, deleted, added]

string $split_mode

Split Mode [words, chars, lines]

Return Value

string

highlighted diff

at line 355
array get_hashtags(string $text_with_hashtags, bool $return_with_hash = false)

Extracts all hashtags in the given text and returns them as array

Parameters

string $text_with_hashtags

Text to parse for #Hashtags

bool $return_with_hash

Set to true if return array shall include the hashtag sign (#)

Return Value

array ['hashtag','#withHashTag']

at line 166
string get_soundex(mixed $word)

Soundex "Like" based on Locale

Parameters

mixed $word

Return Value

string

Sound EX Hash

at line 98
string htmlentities(mixed $text, mixed $encode_tags = true, string $text_encoding = 'UTF-8')

Convert all applicable characters to HTML entities

Parameters

mixed $text
mixed $encode_tags
string $text_encoding

Text Encoding

Return Value

string

Encoded Text

at line 150
bool is_html(string $string)

checks if the string contains any html tags and returns true if so

Parameters

string $string

Return Value

bool

at line 124
string limit_string(string $string, int $charlimit)

Checks if the last character is or isnt a space. (does it the normal way if it is) It explodes the string into an array of seperate words, the effect is... it chops off anything after and including the last space.

Parameters

string $string

Text to cut

int $charlimit

Max Chars to show

Return Value

string