Lines Matching refs:s

86     public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)  argument
88 if (\is_array($s)) {
90 foreach ($s as $str) {
98 $fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
106 $s = base64_decode($s);
111 return base64_encode($s);
119 $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
122 … return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
126 $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
130 return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
145 public static function mb_decode_mimeheader($s) argument
147 return iconv_mime_decode($s, 2, self::$internalEncoding);
150 …public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefe… argument
155 public static function mb_decode_numericentity($s, $convmap, $encoding = null) argument
157 … if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
158 …or('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_W…
168 …or('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_W…
173 $s = (string) $s;
174 if ('' === $s) {
182 if (!preg_match('//u', $s)) {
183 $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
186 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
197 …$s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use …
206 }, $s);
209 return $s;
212 return iconv('UTF-8', $encoding.'//IGNORE', $s);
215 public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) argument
217 … if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
218 …or('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_W…
228 …or('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_W…
234 …r('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_W…
239 $s = (string) $s;
240 if ('' === $s) {
248 if (!preg_match('//u', $s)) {
249 $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
252 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
259 $len = \strlen($s);
263 $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
264 $uchr = substr($s, $i, $ulen);
285 public static function mb_convert_case($s, $mode, $encoding = null) argument
287 $s = (string) $s;
288 if ('' === $s) {
296 if (!preg_match('//u', $s)) {
297 $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s);
300 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
308 $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
322 $s = strtr($s, $caseFolding);
335 $len = \strlen($s);
338 $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"];
339 $uchr = substr($s, $i, $ulen);
349 $s[--$nlen] = $uchr[--$ulen];
352 $s = substr_replace($s, $uchr, $i - $ulen, $ulen);
361 return $s;
364 return iconv('UTF-8', $encoding.'//IGNORE', $s);
515 public static function mb_strlen($s, $encoding = null) argument
519 return \strlen($s);
522 return @iconv_strlen($s, $encoding);
616 public static function mb_strtolower($s, $encoding = null) argument
618 return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
621 public static function mb_strtoupper($s, $encoding = null) argument
623 return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
644 public static function mb_substr($s, $start, $length = null, $encoding = null) argument
648 return (string) substr($s, $start, null === $length ? 2147483647 : $length);
652 $start = iconv_strlen($s, $encoding) + $start;
661 $length = iconv_strlen($s, $encoding) + $length - $start;
667 return (string) iconv_substr($s, $start, $length, $encoding);
771 public static function mb_strwidth($s, $encoding = null) argument
776 $s = iconv($encoding, 'UTF-8//IGNORE', $s);
779s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x…
781 return ($wide << 1) + iconv_strlen($s, 'UTF-8');
797 $s = \chr($code);
799 $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F);
801 $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F);
803 …$s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(…
807 $s = mb_convert_encoding($s, $encoding, 'UTF-8');
810 return $s;
813 public static function mb_ord($s, $encoding = null) argument
816 $s = mb_convert_encoding($s, 'UTF-8', $encoding);
819 if (1 === \strlen($s)) {
820 return \ord($s);
823 $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0;
825 … return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80;
828 return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80;
831 return (($code - 0xC0) << 6) + $s[2] - 0x80;
937 private static function title_case(array $s) argument
939 …return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE…