If I try to encode the url
http://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&cHash=9ef2e9ee006fb16188ebf764232a0ba9
with urlencode()
or http_build_query()
it gives me the result
http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26%23038%3Btx_ttnews%5Btt_news%5D%3D13144%26%23038%3BcHash%3D9ef2e9ee006fb16188ebf764232a0ba9
But that's not what it should be. Is there a known bug? Or problems in use with wordpress?
http%3A%2F%2Fherthabsc.de%2Findex.php%3Fid%3D3631%26tx_ttnews%5Btt_news%5D%3D13144%26cHash%3D9ef2e9ee006fb16188ebf764232a0ba9
when I run it through urlencode()
. Show us your actual code - ceejayoz 2012-04-03 20:39
You've double encoded the URL. Running urldecode()
on your output string is giving me the following: http://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&cHash=9ef2e9ee006fb16188ebf764232a0ba9
EDIT: try the following
urlencode(html_entity_decode('http://herthabsc.de/index.php?id=3631&tx_ttnews[tt_news]=13144&cHash=9ef2e9ee006fb16188ebf764232a0ba9'));