Lines Matching defs:string
11 * Checks if a string contains 7bit ASCII only
15 * @param string $str
24 * Tries to detect if a string is in Unicode encoding
29 * @param string $str
56 * Returns a pure ASCII7 string
60 * @param string $str
61 * @return string
76 * Removes special characters (nonalphanumeric) from a UTF-8 string
83 * @param string $string The UTF8 string to strip of special chars
84 * @param string $repl Replace special with this string
85 * @param string $additional Additional chars to strip (used in regexp char class)
86 * @return string
88 public static function stripspecials($string, $repl = '', $additional = '')
95 return preg_replace('/[' . $additional . '\x00-\x19' . $specials . ']/u', $repl, $string);
103 * PCRE Pattern to locate bad bytes in a UTF-8 string
110 * @param string $str to search
111 * @param string $replace to replace bad bytes with (defaults to '?') - use ASCII
112 * @return string
147 * @param string $string
149 * @return string
151 public static function deaccent($string, $case = 0)
154 $string = strtr($string, Table::lowerAccents());
157 $string = strtr($string, Table::upperAccents());
159 return $string;
163 * Romanize a non-latin string
167 * @param string $string
168 * @return string
170 public static function romanize($string)
172 if (self::isASCII($string)) return $string; //nothing to do
174 return strtr($string, Table::romanization());
178 * adjust a byte index into a utf8 string to a utf8 character boundary
182 * @param string $str utf8 character string