note 81442 added to function.urlencode
| From: | kerdster at gmail dot com | Date: | Thu, 28 Feb 2008 12:02:50 +0000 |
| Subject: | note 81442 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136558@lists.php.net to get a copy of this message | ||
> php dot net at samokhvalov dot com
> 12-Dec-2006 09:49
Thanx for idea!
I have wrote more simple function based on your function to simulate JS function escape (); It uses
mb_string functions unstead of iconv.
<?php
function utf16urlencode($str)
{
$str = mb_convert_encoding($str, 'UTF-16', 'UTF-8');
$out = '';
for ($i = 0; $i < mb_strlen($str, 'UTF-16'); $i++)
{
$out .= '%u'.bin2hex(mb_substr($str, $i, 1, 'UTF-16'));
}
return $out;
}
?>
----
Server IP: 195.54.192.44
Probable Submitter: 195.218.151.22
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- https://master.php.net/note/edit/81442
Del: integrated -- https://master.php.net/note/delete/81442/integrated
Del: useless -- https://master.php.net/note/delete/81442/useless
Del: bad code -- https://master.php.net/note/delete/81442/bad+code
Del: spam -- https://master.php.net/note/delete/81442/spam
Del: non-english -- https://master.php.net/note/delete/81442/non-english
Del: in docs -- https://master.php.net/note/delete/81442/in+docs
Del: other reasons-- https://master.php.net/note/delete/81442
Reject -- https://master.php.net/note/reject/81442
Search -- https://master.php.net/manage/user-notes.php