note 43673 deleted from function.urldecode by tomsommer

From: Date: Wed, 30 Jun 2004 05:13:51 +0000
Subject: note 43673 deleted from function.urldecode by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-72151@lists.php.net to get a copy of this message
Note Submitter: Richard ---- 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,"-","%"))); }

« previous php.notes (#72151) next »