StringPHP Class Reference
String class using php functions. More...
Public Member Functions |
|
check_encoding ($value, $encoding=false) | |
Check if given string matches current
encoding. |
|
convert ($value, $from=false, $to=false) | |
Convert input to current charset. |
|
length ($val) | |
Character set aware strlen(). |
|
stripos ($haystack, $needle, $offset=NULL) | |
strpos ($haystack, $needle, $offset=NULL) | |
strrpos ($haystack, $needle) | |
substr ($val, $start=0, $length=NULL) | |
Character set aware substr. |
|
to_lower ($val) | |
Character set aware strtolower(). |
|
to_upper ($val) | |
Character set aware strtoupper(). |
Detailed Description
String class using php functions.
Definition at line 5 of file string.php.cls.php.
Member Function Documentation
StringPHP::check_encoding | ( | $ | value, | |
$ | encoding = false |
|||
) |
Check if given string matches current encoding.
- Parameters:
-
string $value Value to check string $encoding Encoding to check against. Use FALSE for current encoding
- Returns:
- bool
- Attention:
- This will work with MBString onyl!
Definition at line 15 of file string.php.cls.php.
Convert input to current charset.
- Parameters:
-
string $value Input to convert
- Returns:
- string
Definition at line 25 of file string.php.cls.php.
00025 { 00026 if (empty($to)) { $to = GyroLocale::get_charset(); } 00027 00028 $ret = $value; 00029 if (!empty($from) && function_exists('iconv')) { 00030 $ret = iconv($from, $to . '//IGNORE', $value); 00031 } 00032 return $ret; 00033 }
StringPHP::length | ( | $ | val | ) |
Character set aware strlen().
Definition at line 60 of file string.php.cls.php.
StringPHP::stripos | ( | $ | haystack, | |
$ | needle, | |||
$ | offset = NULL |
|||
) |
Definition at line 68 of file string.php.cls.php.
00068 { 00069 return stripos($haystack, $needle, $offset); 00070 }
StringPHP::strpos | ( | $ | haystack, | |
$ | needle, | |||
$ | offset = NULL |
|||
) |
Definition at line 64 of file string.php.cls.php.
00064 { 00065 return strpos($haystack, $needle, $offset); 00066 }
StringPHP::strrpos | ( | $ | haystack, | |
$ | needle | |||
) |
Definition at line 72 of file string.php.cls.php.
00072 { 00073 if ($haystack == '') { 00074 return false; 00075 } 00076 return strrpos($haystack, $needle); 00077 }
StringPHP::substr | ( | $ | val, | |
$ | start = 0 , |
|||
$ | length = NULL |
|||
) |
Character set aware substr.
Definition at line 82 of file string.php.cls.php.
StringPHP::to_lower | ( | $ | val | ) |
Character set aware strtolower().
- Parameters:
-
String Value to convert into lowercase
- Returns:
- String converted string
Definition at line 42 of file string.php.cls.php.
StringPHP::to_upper | ( | $ | val | ) |
Character set aware strtoupper().
- Parameters:
-
String Value to convert into upper case
- Returns:
- String converted string
Definition at line 53 of file string.php.cls.php.
The documentation for this class was generated from the following file:
- gyro/core/lib/helpers/string_impl/string.php.cls.php