note 85055 added to function.urlencode
| From: | root at jusme dot org | Date: | Wed, 13 Aug 2008 00:12:16 +0000 |
| Subject: | note 85055 added to function.urlencode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143428@lists.php.net to get a copy of this message | ||
I'm running PHP version 5.0.5 and urlencode() doesn't seem to encode the "#"
character, although the function's description says it encodes "all non-alphanumeric"
characters. This was a particular problem for me when trying to open local files with a
"#" in the filename as Firefox will interpret this as an anchor target (for better or
worse). It seems a manual str_replace is required unless this was fixed in a future PHP version.
Example:
$str = str_replace("#", "%23", $str);
----
Server IP: 69.147.83.197
Probable Submitter: 71.231.172.146
----
Manual Page -- http://www.php.net/manual/en/function.urlencode.php
Edit -- https://master.php.net/note/edit/85055
Del: integrated -- https://master.php.net/note/delete/85055/integrated
Del: useless -- https://master.php.net/note/delete/85055/useless
Del: bad code -- https://master.php.net/note/delete/85055/bad+code
Del: spam -- https://master.php.net/note/delete/85055/spam
Del: non-english -- https://master.php.net/note/delete/85055/non-english
Del: in docs -- https://master.php.net/note/delete/85055/in+docs
Del: other reasons-- https://master.php.net/note/delete/85055
Reject -- https://master.php.net/note/reject/85055
Search -- https://master.php.net/manage/user-notes.php