Lines Matching refs:s

81     public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)  argument
84 $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
92 $s = base64_decode($s);
97 return base64_encode($s);
105 $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s);
108 … return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
112 $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
116 return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
131 public static function mb_decode_mimeheader($s) argument
133 return \iconv_mime_decode($s, 2, self::$internalEncoding);
136 …public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefe… argument
141 public static function mb_decode_numericentity($s, $convmap, $encoding = null) argument
143 if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
144 …or('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_W…
154 …or('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_W…
159 $s = (string) $s;
160 if ('' === $s) {
168 if (!preg_match('//u', $s)) {
169 $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
172 $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
183 …$s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use …
192 }, $s);
195 return $s;
198 return \iconv('UTF-8', $encoding.'//IGNORE', $s);
201 public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) argument
203 if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
204 …or('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_W…
214 …or('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_W…
220 …r('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_W…
225 $s = (string) $s;
226 if ('' === $s) {
234 if (!preg_match('//u', $s)) {
235 $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
238 $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
245 $len = \strlen($s);
249 $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
250 $uchr = substr($s, $i, $ulen);
271 public static function mb_convert_case($s, $mode, $encoding = null) argument
273 $s = (string) $s;
274 if ('' === $s) {
282 if (!preg_match('//u', $s)) {
283 $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s);
286 $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
294 $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
304 $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s);
317 $len = \strlen($s);
320 $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
321 $uchr = substr($s, $i, $ulen);
331 $s[--$nlen] = $uchr[--$ulen];
334 $s = substr_replace($s, $uchr, $i - $ulen, $ulen);
343 return $s;
346 return \iconv('UTF-8', $encoding.'//IGNORE', $s);
484 public static function mb_strlen($s, $encoding = null) argument
488 return \strlen($s);
491 return @\iconv_strlen($s, $encoding);
584 public static function mb_strtolower($s, $encoding = null) argument
586 return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
589 public static function mb_strtoupper($s, $encoding = null) argument
591 return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
612 public static function mb_substr($s, $start, $length = null, $encoding = null) argument
616 return (string) substr($s, $start, null === $length ? 2147483647 : $length);
620 $start = \iconv_strlen($s, $encoding) + $start;
629 $length = \iconv_strlen($s, $encoding) + $length - $start;
635 return (string) \iconv_substr($s, $start, $length, $encoding);
734 public static function mb_strwidth($s, $encoding = null) argument
739 $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
742s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x…
744 return ($wide << 1) + \iconv_strlen($s, 'UTF-8');
760 $s = \chr($code);
762 $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
764 $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
766 …$s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(…
770 $s = mb_convert_encoding($s, $encoding, 'UTF-8');
773 return $s;
776 public static function mb_ord($s, $encoding = null) argument
779 $s = mb_convert_encoding($s, 'UTF-8', $encoding);
782 if (1 === \strlen($s)) {
783 return \ord($s);
786 $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
788 … return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
791 return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
794 return (($code - 0xC0) << 6) + $s[2] - 0x80;
837 private static function title_case(array $s) argument
839 …return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE…