note 68668 deleted from function.urlencode by peehaa
| From: | peehaa@php.net | Date: | Fri, 06 Jan 2017 15:48:39 +0000 |
| Subject: | note 68668 deleted from function.urlencode by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208692@lists.php.net to get a copy of this message | ||
Note Submitter: peter at runempire dot com
----
I think this was mentioned earlier but it was confusing.. But I had some problems with the urlencode
eating my '/' so I did a simple str_replace like the following:
$url = urlencode($img);
$img2 = "$url";
$img2 = str_replace('%2F54', '/', $img2);
$img2 = str_replace('+' , '%20' , $img2);
You don't need to replace the '+' but I just feel comfortable with my %20, although
it may present a problem if whatever you're using the str_replace for has a '+' in it
where it shouldn't be.
But that fixed my problem.. all the other encodes like htmlentities and rawurlencode just ate my
/'s