Lines Matching defs:str
15 * @param string $str
18 public static function isASCII($str)
20 return (preg_match('/(?:[^\x00-\x7F])/', $str) !== 1);
29 * @param string $str
32 public static function isUtf8($str)
34 $len = strlen($str);
36 $b = ord($str[$i]);
46 if ((++$i === $len) || ((ord($str[$i]) & 0xC0) !== 0x80))
60 * @param string $str
63 public static function strip($str)
66 $len = strlen($str);
68 if (ord($str[$i]) < 128) {
69 $ascii .= $str[$i];
110 * @param string $str to search
114 public static function replaceBadBytes($str, $replace = '')
127 while (preg_match('/' . $UTF8_BAD . '/S', $str, $matches)) {
133 $str = substr($str, strlen($matches[0]));
182 * @param string $str utf8 character string
183 * @param int $i byte index into $str
185 * @return int byte index into $str now pointing to a utf8 character boundary
187 public static function correctIdx($str, $i, $next = false)
192 $limit = strlen($str);
196 while (($i < $limit) && ((ord($str[$i]) & 0xC0) === 0x80)) $i++;
198 while ($i && ((ord($str[$i]) & 0xC0) === 0x80)) $i--;