* Executes a regular expression match with extended multibyte support.
* By default this function uses the platform character set.
* @param string $pattern The regular expression pattern.
* @param string $string The searched string.
* @param array $regs If specified, by this passed by reference parameter an array containing found match and its substrings is returned.
* @return mixed 1 if match is found, FALSE if not. If $regs has been specified, byte-length of the found match is returned, or FALSE if no match has been found.
* This function is aimed at replacing the functions ereg() and mb_ereg() for human-language strings.
* Scans string for matches to pattern, then replaces the matched text with replacement, with extended multibyte support.
* By default this function uses the platform character set.
* @param string $pattern The regular expression pattern.
* @param string $replacement The replacement text.
* @param string $string The searched string.
* @param string $option Matching condition.
* If i is specified for the matching condition parameter, the case will be ignored.
* If x is specified, white space will be ignored.
* If m is specified, match will be executed in multiline mode and line break will be included in '.'.
* If p is specified, match will be executed in POSIX mode, line break will be considered as normal character.
* If e is specified, replacement string will be evaluated as PHP expression.
* @return mixed The modified string is returned. If no matches are found within the string, then it will be returned unchanged. FALSE will be returned on error.
* This function is aimed at replacing the functions ereg_replace() and mb_ereg_replace() for human-language strings.
* Executes a regular expression match, ignoring case, with extended multibyte support.
* By default this function uses the platform character set.
* @param string $pattern The regular expression pattern.
* @param string $string The searched string.
* @param array $regs If specified, by this passed by reference parameter an array containing found match and its substrings is returned.
* @return mixed 1 if match is found, FALSE if not. If $regs has been specified, byte-length of the found match is returned, or FALSE if no match has been found.
* This function is aimed at replacing the functions eregi() and mb_eregi() for human-language strings.
* Scans string for matches to pattern, then replaces the matched text with replacement, ignoring case, with extended multibyte support.
* By default this function uses the platform character set.
* @param string $pattern The regular expression pattern.
* @param string $replacement The replacement text.
* @param string $string The searched string.
* @param string $option Matching condition.
* If i is specified for the matching condition parameter, the case will be ignored.
* If x is specified, white space will be ignored.
* If m is specified, match will be executed in multiline mode and line break will be included in '.'.
* If p is specified, match will be executed in POSIX mode, line break will be considered as normal character.
* If e is specified, replacement string will be evaluated as PHP expression.
* @return mixed The modified string is returned. If no matches are found within the string, then it will be returned unchanged. FALSE will be returned on error.
* This function is aimed at replacing the functions eregi_replace() and mb_eregi_replace() for human-language strings.
* Returns a string with the first character lowercased if that character is alphabetic.
* @param string $string The input string.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string The result string.
* This function is aimed at replacing the function lcfirst() for human-language strings.
* This function returns a string or an array with all occurrences of search in subject (ignoring case) replaced with the given replace value.
* @param mixed $search String or array of strings to be found.
* @param mixed $replace String or array of strings used for replacement.
* @param mixed $subject String or array of strings being searced.
* @param int $count The number of matched and replaced needles will be returned in count, which is passed by reference.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed String or array as a result.
* Notes:
* If $subject is an array, then the search and replace is performed with every entry of subject, the return value is an array.
* If $search and $replace are arrays, then the function takes a value from each array and uses it to do search and replace on subject.
* If $replace has fewer values than search, then an empty string is used for the rest of replacement values.
* If $search is an array and $replace is a string, then this replacement string is used for every value of search.
* This function is aimed at replacing the function str_ireplace() for human-language strings.
* @param int $split_length Maximum character-length of the chunk, one character by default.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return array The result array of chunks with the spcified length.
* Notes:
* If the optional split_length parameter is specified, the returned array will be broken down into chunks
* with each being split_length in length, otherwise each chunk will be one character in length.
* FALSE is returned if split_length is less than 1.
* If the split_length length exceeds the length of string, the entire string is returned as the first (and only) array element.
* This function is aimed at replacing the function str_split() for human-language strings.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* This function is aimed at replacing the function strcasecmp() for human-language strings.
* Finds position of first occurrence of a string within another, case insensitive.
* @param string $haystack The string from which to get the position of the first occurrence.
* @param string $needle The string to be found.
* @param int $offset The position in $haystack to start searching from. If it is omitted, searching starts from the beginning.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Return the numeric position of the first occurrence of $needle in the $haystack, or FALSE if $needle is not found.
* Note: The first character's position is 0, the second character position is 1, and so on.
* This function is aimed at replacing the functions stripos() and mb_stripos() for human-language strings.
* Finds first occurrence of a string within another, case insensitive.
* @param string $haystack The string from which to get the first occurrence.
* @param string @needle The string to be found.
* @param bool $part Determines which portion of $haystack this function returns. The default value is FALSE.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Returns the portion of $haystack, or FALSE if $needle is not found.
* Notes:
* If $part is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle.
* If $part is set to FALSE, the function returns all of $haystack from the first occurrence of $needle to the end.
* This function is aimed at replacing the functions stristr() and mb_stristr() for human-language strings.
* @param string $string The string which length is to be calculated.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns the number of characters within the string. A multi-byte character is counted as 1.
* This function is aimed at replacing the functions strlen() and mb_strlen() for human-language strings.
* Finds position of first occurrence of a string within another.
* @param string $haystack The string from which to get the position of the first occurrence.
* @param string $needle The string to be found.
* @param int $offset The position in $haystack to start searching from. If it is omitted, searching starts from the beginning.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Return the numeric position of the first occurrence of $needle in the $haystack, or FALSE if $needle is not found.
* Note: The first character's position is 0, the second character position is 1, and so on.
* This function is aimed at replacing the functions strpos() and mb_strpos() for human-language strings.
* Finds the last occurrence of a character in a string.
* @param string $haystack The string from which to get the last occurrence.
* @param string $needle The string which first character is to be found.
* @param bool $part Determines which portion of $haystack this function returns. The default value is FALSE.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Returns the portion of $haystack, or FALSE if the first character from $needle is not found.
* Notes:
* If $part is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence.
* If $part is set to FALSE, the function returns all of $haystack from the first occurrence to the end.
* This function is aimed at replacing the functions strrchr() and mb_strrchr() for human-language strings.
* @param string $string The string to be reversed.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the reversed string.
* This function is aimed at replacing the function strrev() for human-language strings.
* Finds the position of last occurrence of a string in a string.
* @param string $haystack The string from which to get the position of the last occurrence.
* @param string $needle The string to be found.
* @param int $offset $offset may be specified to begin searching an arbitrary position. Negative values will stop searching at an arbitrary point prior to the end of the string.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Return the numeric position of the first occurrence of $needle in the $haystack, or FALSE if $needle is not found.
* Note: The first character's position is 0, the second character position is 1, and so on.
* This function is aimed at replacing the functions strrpos() and mb_strrpos() for human-language strings.
* Finds first occurrence of a string within another.
* @param string $haystack The string from which to get the first occurrence.
* @param string @needle The string to be found.
* @param bool $part Determines which portion of $haystack this function returns. The default value is FALSE.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return mixed Returns the portion of $haystack, or FALSE if $needle is not found.
* Notes:
* If $part is set to TRUE, the function returns all of $haystack from the beginning to the first occurrence of $needle.
* If $part is set to FALSE, the function returns all of $haystack from the first occurrence of $needle to the end.
* This function is aimed at replacing the functions strstr() and mb_strstr() for human-language strings.
* @param string $string The string being lowercased.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the string with all alphabetic characters converted to lowercase.
* This function is aimed at replacing the functions strtolower() and mb_strtolower() for human-language strings.
* @param string $string The string being uppercased.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the string with all alphabetic characters converted to uppercase.
* This function is aimed at replacing the functions strtoupper() and mb_strtoupper() for human-language strings.
* @param string $string The string being translated.
* @param mixed $from A string that contains the character to be replaced. This parameter can be also an array with pairs of characters 'from' => 'to'.
* @param string $to A string that contains the replacing characters.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string This function returns a copy of $string, translating all occurrences of each character in $from to the corresponding character in $to.
* This function is aimed at replacing the function strtr() for human-language strings.
* @link http://php.net/manual/en/function.strtr
* TODO: To be revised and tested. Probably this function will be not needed.
* @param int $start The first position from which the extracted part begins.
* @param int $length The length in character of the extracted part.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the part of the string specified by the start and length parameters.
* Note: First character's position is 0. Second character position is 1, and so on.
* This function is aimed at replacing the functions substr() and mb_substr() for human-language strings.
* @param string $replacement The replacement string.
* @param int $start The position from which replacing will begin.
* Notes:
* If $start is positive, the replacing will begin at the $start'th offset into the string.
* If $start is negative, the replacing will begin at the $start'th character from the end of the string.
* @param int $length The position where replacing will end.
* Notes:
* If given and is positive, it represents the length of the portion of the string which is to be replaced.
* If it is negative, it represents the number of characters from the end of string at which to stop replacing.
* If it is not given, then it will default to api_strlen($string); i.e. end the replacing at the end of string.
* If $length is zero, then this function will have the effect of inserting replacement into the string at the given start offset.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string The result string is returned.
* This function is aimed at replacing the function substr_replace() for human-language strings.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns a string with the first character capitalized, if that character is alphabetic.
* This function is aimed at replacing the function ucfirst() for human-language strings.
* Uppercases the first character of each word in a string.
* @param string $string The input string.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the modified string.
* This function is aimed at replacing the function ucwords() for human-language strings.
* This function adds a unicode modifier (u suffix) to a Perl-compatible regular expression depending on the specified encoding.
* @param string $pcre The Perl-compatible regular expression.
* @param string $encoding The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return string Returns the same regular expression wit a suffix 'u' if $encoding is 'UTF-8'.