note 43673 added to function.urldecode

From: Date: Wed, 30 Jun 2004 00:27:21 +0000
Subject: note 43673 added to function.urldecode
Groups: php.notes 
Request: Send a blank email to php-notes+get-72142@lists.php.net to get a copy of this message
In reply to: mhe75fr Thanks for your code - it's great to stop the browser interpreting the %, but it fails if you want to encode->decode a literal dash (-). I have the following: function encodeQueryUrl($url){ return strtr(urlencode(str_replace('-','%2D',$url)),"%","-"); } function decodeQueryUrl($url){ return str_replace('%2D','-',urldecode(strtr($url,"-","%"))); } ---- Manual Page -- http://www.php.net/manual/en/function.urldecode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43673 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43673&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43673&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#72142) next »