Lines Matching defs:arr
183 * @param array $arr of unicode code points representing a string
194 public static function toUtf8($arr, $strict = false)
196 if (!is_array($arr)) return '';
199 foreach (array_keys($arr) as $k) {
200 if (($arr[$k] >= 0) && ($arr[$k] <= 0x007f)) {
202 echo chr($arr[$k]);
203 } elseif ($arr[$k] <= 0x07ff) {
205 echo chr(0xc0 | ($arr[$k] >> 6));
206 echo chr(0x80 | ($arr[$k] & 0x003f));
207 } elseif ($arr[$k] == 0xFEFF) {
210 } elseif ($arr[$k] >= 0xD800 && $arr[$k] <= 0xDFFF) {
216 'at index: ' . $k . ', value: ' . $arr[$k],
221 } elseif ($arr[$k] <= 0xffff) {
223 echo chr(0xe0 | ($arr[$k] >> 12));
224 echo chr(0x80 | (($arr[$k] >> 6) & 0x003f));
225 echo chr(0x80 | ($arr[$k] & 0x003f));
226 } elseif ($arr[$k] <= 0x10ffff) {
228 echo chr(0xf0 | ($arr[$k] >> 18));
229 echo chr(0x80 | (($arr[$k] >> 12) & 0x3f));
230 echo chr(0x80 | (($arr[$k] >> 6) & 0x3f));
231 echo chr(0x80 | ($arr[$k] & 0x3f));
235 'at index: ' . $k . ', value: ' . $arr[$k],