Lines Matching refs:s

20  * - mb_convert_variables    - Convert character code in variable(s)
74 ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'],
81 public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
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)
133 return \iconv_mime_decode($s, 2, self::$internalEncoding);
136 public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
141 public static function mb_decode_numericentity($s, $convmap, $encoding = null)
143 if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
144 trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
154 trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
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 ($cnt, $convmap) {
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)
203 if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
204 trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
214 trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
220 trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING);
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)
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);
367 throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
388 throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang));
484 public static function mb_strlen($s, $encoding = null)
488 return \strlen($s);
491 return @\iconv_strlen($s, $encoding);
584 public static function mb_strtolower($s, $encoding = null)
586 return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
589 public static function mb_strtoupper($s, $encoding = null)
591 return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
612 public static function mb_substr($s, $start, $length = null, $encoding = null)
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)
739 $s = \iconv($encoding, 'UTF-8//IGNORE', $s);
742 $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide);
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(0x80 | $code & 0x3F);
770 $s = mb_convert_encoding($s, $encoding, 'UTF-8');
773 return $s;
776 public static function mb_ord($s, $encoding = null)
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)
839 return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8');