Static Public Member Functions | |
static | explodeAssign ($string, $seperator, $vars) |
Split string using a seperator and assign the resulting parts to variables. | |
static | arrayAssign ($array, $vars) |
Assign the elements in an array to separate variables. | |
static | isOfChars ($string, $chars) |
Check if a string consists of (and only of) a bunch of characters. | |
static | startsWith ($string, $start) |
Check if a string starts with a certain other string. | |
static | endsWith ($string, $end) |
Check if a string ends with a certain other string. |
Various string manipulation stuff. Please note that this is NOT A GENERIC STRING CLASS! This may also very well clash with other user libraries.
Definition at line 68 of file tlib.php.
static TLString::arrayAssign | ( | $ | array, | |
$ | vars | |||
) | [static] |
Assign the elements in an array to separate variables.
$foo = array('bar', 'bas'); TLString::arrayAssign($foo, (&$bar, &$bas) );
$array | (array) Array of which to assign elements | |
$vars | (ass. array) Associative array containing pass-by-reference variables to which to asign the parts of the exploded string. Number of vars must be equal to the number of parts that are the result of the split (or false will be returned). |
static TLString::endsWith | ( | $ | string, | |
$ | end | |||
) | [static] |
static TLString::explodeAssign | ( | $ | string, | |
$ | seperator, | |||
$ | vars | |||
) | [static] |
Split string using a seperator and assign the resulting parts to variables.
Example:
$foo = "foo,bar,bas"; TLString::explodeAssign($foo, ",", (&foo, &$bar, &$bas) );
$string | (string) String to split. | |
$seperator | (char) Character to split on. | |
$vars | (ass. array) Associative array containing pass-by-reference variables to which to asign the parts of the exploded string. Number of vars must be equal to the number of parts that are the result of the split (or false will be returned). |
static TLString::isOfChars | ( | $ | string, | |
$ | chars | |||
) | [static] |
Check if a string consists of (and only of) a bunch of characters.
$string | (string) String to check. Must be a string otherwise return value may not be correct. | |
$chars | (string) Collection of character to check for. Ranges can be defined by using a-z. |
If you want to check for a dash ('-'), you must escape it: isOfChars("-hey-", "a-z\-")
static TLString::startsWith | ( | $ | string, | |
$ | start | |||
) | [static] |