|
Moodle
2.2.1
http://www.collinsharper.com
|
Static Public Member Functions | |
| static | parse_charset ($charset) |
| static | convert ($text, $fromCS, $toCS='utf-8') |
| static | substr ($text, $start, $len=null, $charset='utf-8') |
| static | strlen ($text, $charset='utf-8') |
| static | strtolower ($text, $charset='utf-8') |
| static | strtoupper ($text, $charset='utf-8') |
| static | strpos ($haystack, $needle, $offset=0) |
| static | strrpos ($haystack, $needle) |
| static | specialtoascii ($text, $charset='utf-8') |
| static | encode_mimeheader ($text, $charset='utf-8') |
| static | entities_to_utf8 ($str, $htmlent=true) |
| static | utf8_to_entities ($str, $dec=false, $nonnum=false) |
| static | trim_utf8_bom ($str) |
| static | get_encodings () |
| static | code2utf8 ($num) |
| static | strtotitle ($text) |
| static | asort (array &$arr, $sortflag=null) |
Static Protected Member Functions | |
| static | typo3 () |
Definition at line 58 of file textlib.class.php.
Locale aware sorting, the key associations are kept, values are sorted alphabetically.
| array | $arr | array to be sorted (reference) |
| int | $sortflag | One of Collator::SORT_REGULAR, Collator::SORT_NUMERIC, Collator::SORT_STRING |
Definition at line 590 of file textlib.class.php.

| static code2utf8 | ( | $ | num | ) | [static] |
Returns the utf8 string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
| int | $num | one unicode value |
Definition at line 531 of file textlib.class.php.

| static convert | ( | $ | text, |
| $ | fromCS, | ||
| $ | toCS = 'utf-8' |
||
| ) | [static] |
Converts the text between different encodings. It uses iconv extension with //TRANSLIT parameter, falls back to typo3. Returns false if fails.
| string | $text | |
| string | $fromCS | source encoding |
| string | $toCS | result encoding |
Definition at line 162 of file textlib.class.php.


| static encode_mimeheader | ( | $ | text, |
| $ | charset = 'utf-8' |
||
| ) | [static] |
Generate a correct base64 encoded header to be used in MIME mail messages. This function seems to be 100% compliant with RFC1342. Credits go to: paravoid (http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283).
| string | $text | |
| string | $charset | encoding of the text |
Definition at line 351 of file textlib.class.php.


| static entities_to_utf8 | ( | $ | str, |
| $ | htmlent = true |
||
| ) | [static] |
Converts all the numeric entities &#nnnn; or &#xnnn; to UTF-8 Original from laurynas dot butkus at gmail at: http://php.net/manual/en/function.html-entity-decode.php#75153 with some custom mods to provide more functionality
| string | $str | input string |
| boolean | $htmlent | convert also html entities (defaults to true) |
NOTE: we could have used typo3 entities_to_utf8() here but the direct alternative used runs 400% quicker and uses 0.5Mb less memory, so, let's use it (tested against 10^6 conversions)
Definition at line 444 of file textlib.class.php.

| static get_encodings | ( | ) | [static] |
Returns encoding options for select boxes, utf-8 and platform encoding first
Definition at line 507 of file textlib.class.php.


| static parse_charset | ( | $ | charset | ) | [static] |
Standardise charset name
Please note it does not mean the returned charset is actually supported.
| string | $charset | raw charset name |
Definition at line 115 of file textlib.class.php.


| static specialtoascii | ( | $ | text, |
| $ | charset = 'utf-8' |
||
| ) | [static] |
Try to convert upper unicode characters to plain ascii, the returned string may contain unconverted unicode characters.
| string | $text | |
| string | $charset | encoding of the text |
Definition at line 334 of file textlib.class.php.


| static strlen | ( | $ | text, |
| $ | charset = 'utf-8' |
||
| ) | [static] |
Multibyte safe strlen() function, uses mbstring or iconv for UTF-8, falls back to typo3.
| string | $text | |
| string | $charset | encoding of the text |
Definition at line 235 of file textlib.class.php.


| static strpos | ( | $ | haystack, |
| $ | needle, | ||
| $ | offset = 0 |
||
| ) | [static] |
UTF-8 ONLY safe strpos(), uses mbstring, falls back to iconv.
| string | $haystack | |
| string | $needle | |
| int | $offset |
Definition at line 303 of file textlib.class.php.

| static strrpos | ( | $ | haystack, |
| $ | needle | ||
| ) | [static] |
UTF-8 ONLY safe strrpos(), uses mbstring, falls back to iconv.
| string | $haystack | |
| string | $needle |
Definition at line 318 of file textlib.class.php.

| static strtolower | ( | $ | text, |
| $ | charset = 'utf-8' |
||
| ) | [static] |
Multibyte safe strtolower() function, uses mbstring, falls back to typo3.
| string | $text | |
| string | $charset | encoding of the text (may not work for all encodings) |
Definition at line 260 of file textlib.class.php.


| static strtotitle | ( | $ | text | ) | [static] |
Makes first letter of each word capital - words must be separated by spaces. Use with care, this function does not work properly in many locales!!!
| string | $text |
Definition at line 554 of file textlib.class.php.


| static strtoupper | ( | $ | text, |
| $ | charset = 'utf-8' |
||
| ) | [static] |
Multibyte safe strtoupper() function, uses mbstring, falls back to typo3.
| string | $text | |
| string | $charset | encoding of the text (may not work for all encodings) |
Definition at line 281 of file textlib.class.php.


| static substr | ( | $ | text, |
| $ | start, | ||
| $ | len = null, |
||
| $ | charset = 'utf-8' |
||
| ) | [static] |
Multibyte safe substr() function, uses mbstring or iconv for UTF-8, falls back to typo3.
| string | $text | |
| int | $start | negative value means from end |
| int | $len | |
| string | $charset | encoding of the text |
Definition at line 193 of file textlib.class.php.


| static trim_utf8_bom | ( | $ | str | ) | [static] |
Removes the BOM from unicode string - see http://unicode.org/faq/utf_bom.html
| string | $str |
Definition at line 495 of file textlib.class.php.


| static typo3 | ( | ) | [static, protected] |
Return t3lib helper class
Definition at line 64 of file textlib.class.php.


| static utf8_to_entities | ( | $ | str, |
| $ | dec = false, |
||
| $ | nonnum = false |
||
| ) | [static] |
Converts all Unicode chars > 127 to numeric entities &#nnnn; or &#xnnn;.
| string | $str | input string |
| boolean | $dec | output decadic only number entities |
| boolean | $nonnum | remove all non-numeric entities |
Definition at line 474 of file textlib.class.php.

