note 77911 added to function.chr
| From: | MiguelPerez at osu1 dot php dot net | Date: | Wed, 19 Sep 2007 13:48:08 +0000 |
| Subject: | note 77911 added to function.chr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130597@lists.php.net to get a copy of this message | ||
This is my implementation of unichr:
<?php
function unichr($c) {
if ($c <= 0x7F) {
return chr($c);
} else if ($c <= 0x7FF) {
return chr(0xC0 | $c >> 6) . chr(0x80 | $c & 0x3F);
} else if ($c <= 0xFFFF) {
return chr(0xE0 | $c >> 12) . chr(0x80 | $c >> 6 & 0x3F)
. chr(0x80 | $c & 0x3F);
} else if ($c <= 0x10FFFF) {
return chr(0xF0 | $c >> 18) . chr(0x80 | $c >> 12 & 0x3F)
. chr(0x80 | $c >> 6 & 0x3F)
. chr(0x80 | $c & 0x3F);
} else {
return false;
}
}
?>
----
Server IP: 130.206.1.5
Probable Submitter: 217.125.117.197
----
Manual Page -- http://www.php.net/manual/en/function.chr.php
Edit -- https://master.php.net/note/edit/77911
Del: integrated -- https://master.php.net/note/delete/77911/integrated
Del: useless -- https://master.php.net/note/delete/77911/useless
Del: bad code -- https://master.php.net/note/delete/77911/bad+code
Del: spam -- https://master.php.net/note/delete/77911/spam
Del: non-english -- https://master.php.net/note/delete/77911/non-english
Del: in docs -- https://master.php.net/note/delete/77911/in+docs
Del: other reasons-- https://master.php.net/note/delete/77911
Reject -- https://master.php.net/note/reject/77911
Search -- https://master.php.net/manage/user-notes.php