Class: atkString
Source Location: /utils/class.atkstring.inc
Class atkString
Class Overview
|
This file is part of the Achievo ATK distribution.
Detailed copyright and licensing information can be found in the doc/COPYRIGHT and doc/LICENSE files which should be included in the distribution. String class for multibyte (utf-8) character support
Located in /utils/class.atkstring.inc [line 20]
Wiki documentation
Author(s):
Information Tags:
| Version: | $Revision$ $Id: class.atkstring.inc 6355 2009-04-21 15:20:09Z lineke $ |
| Copyright: | (c)2009 Ibuildings |
| License: | ATK Open Source License |
|
Properties
|
Methods
|
Method Summary
| static
string
|
charAt() |
Return char on given position |
| static
String
|
htmlentities() |
ATK version of the PHP htmlentities function. Works just like PHP's htmlentities function, but falls back to atkGetCharset() instead of PHP's default charset, if no charset is given. |
| static
String
|
html_entity_decode() |
ATK version of the PHP html_entity_decode function. Works just like PHP's html_entity_decode function, but falls back to the in the language file configured charset instead of PHP's default charset, if no charset is given. |
| static
String
|
iconv() |
ATK version of the PHP html_entity_decode function. Works just like PHP's html_entity_decode function, but falls back to atkGetCharset() instead of PHP's default charset, if no charset is given. |
| static
int
|
strlen() |
Get string length |
| static
int|boolean
|
strpos() |
Find position of first occurrence of string in a string |
| static
string
|
strtolower() |
Make a string lowercase |
| static
string
|
strtoupper() |
Make a string uppercase |
| static
string
|
substr() |
Get part of string |
| static
string
|
truncate() |
ATK version of the Smarty truncate function, multibyte safe. |
Properties
Accepted charsets for htmlentities and html_entity_decode
Do we have multibyte support
Methods
static string charAt(
string
$str, int
$pos
)
|
|
Return char on given position
Parameters:
|
string |
$str: |
The string being checked |
|
int |
$pos: |
The position of the char |
API Tags:
static boolean hasMultiByteSupport(
)
|
|
Check if the system has multibyte support
API Tags:
static String htmlentities(
String
$str, [int
$quote_style = ENT_COMPAT], [String
$charset = null]
)
|
|
ATK version of the PHP htmlentities function. Works just like PHP's htmlentities function, but falls back to atkGetCharset() instead of PHP's default charset, if no charset is given.
Parameters:
|
String |
$str: |
string to convert |
|
int |
$quote_style: |
quote style (defaults to ENT_COMPAT) |
|
String |
$charset: |
character set to use (default to atkGetCharset()) |
API Tags:
| Return: | encoded string |
| Access: | public |
static String html_entity_decode(
String
$str, [int
$quote_style = ENT_COMPAT], [String
$charset = null]
)
|
|
ATK version of the PHP html_entity_decode function. Works just like PHP's html_entity_decode function, but falls back to the in the language file configured charset instead of PHP's default charset, if no charset is given.
Parameters:
|
String |
$str: |
string to convert |
|
int |
$quote_style: |
quote style (defaults to ENT_COMPAT) |
|
String |
$charset: |
character set to use (default to atktext('charset', 'atk')) |
API Tags:
| Return: | encoded string |
| Access: | public |
static String iconv(
string
$in_charset, string
$out_charset, string
$str
)
|
|
ATK version of the PHP html_entity_decode function. Works just like PHP's html_entity_decode function, but falls back to atkGetCharset() instead of PHP's default charset, if no charset is given.
Parameters:
|
string |
$in_charset: |
The input charset |
|
string |
$out_charset: |
The output charset |
|
string |
$str: |
The string to convert |
API Tags:
| Return: | encoded string |
| Access: | public |
static int strlen(
string
$str
)
|
|
Get string length
Parameters:
|
string |
$str: |
The string being checked for length |
API Tags:
static int|boolean strpos(
object
$haystack, object
$needle, [
$offset = 0], object
$offset[optional]
)
|
|
Find position of first occurrence of string in a string
Parameters:
|
object |
$haystack: |
The string being checked. |
|
object |
$needle: |
The position counted from the beginning of haystack . |
|
object |
$offset[optional]: |
The search offset. If it is not specified, 0 is used. |
|
|
$offset: |
|
API Tags:
static string strtolower(
string
$str
)
|
|
Make a string lowercase
Parameters:
|
string |
$str: |
The string being lowercased. |
API Tags:
static string strtoupper(
string
$str
)
|
|
Make a string uppercase
Parameters:
|
string |
$str: |
The string being uppercased. |
API Tags:
static string substr(
string
$str, int
$start, [
$length = ''], int
$length[optional]
)
|
|
Get part of string
Parameters:
|
string |
$str: |
The string being checked. |
|
int |
$start: |
The first position used in $str |
|
int |
$length[optional]: |
The maximum length of the returned string |
|
|
$length: |
|
API Tags:
static string truncate(
string
$string, integer
$max, string
$replace
)
|
|
ATK version of the Smarty truncate function, multibyte safe.
Parameters:
|
string |
$string: |
text to truncate |
|
integer |
$max: |
Maximum length of the total result string |
|
string |
$replace: |
text to append to the end of the truncated string |
API Tags:
| Return: | truncated sting |
| Access: | public |