Lines Matching defs:string
41 * @param string $string
42 * @return string
44 public static function cleanUnicode($string)
48 return str_replace($character, $replace, html_entity_decode($string, ENT_QUOTES, "UTF-8"));
54 * @param string $string
55 * @return string
57 public static function trim($string)
59 $string = mb_ereg_replace('^\s*', '', $string); // left trim
60 $string = mb_ereg_replace('\s*$', '', $string); // right trim
61 return $string;
68 * @param string $pattern
69 * @param string $string
74 public static function split($pattern, $string, $limit = -1, $flags = 0)
78 $lengths = self::getSplitLengths($pattern, $string);
86 $parts[] = self::makePart($string, $position, null, $offset_capture);
91 $parts[] = self::makePart($string, $position, $length[0], $offset_capture);
136 * @param string $string
140 * @return array|string
142 private static function makePart($string, $position, $length = null, $offset_capture = false)
144 $cut = mb_strcut($string, $position, $length);
152 * Splits the string by pattern and for each element (part or split) returns:
156 * @param $string
159 private static function getSplitLengths($pattern, $string)
161 $strlen = strlen($string); // bytes!
164 mb_ereg_search_init($string);