I have the following URL: $url = 'http://mysite.com/?p=welcome&x=1&y=2';
I need to decode it so that header("Location: $url");
actually works.
However, using urldecode($url)
is not working because it's not decoding the &
-> &
and so the browser is getting redirected to http://mysite.com/?p=welcome&x=1&y=2
which fails.
I need it to decode so that it looks like: http://mysite.com/?p=welcome&x=1&y=2
How do I do that?
Type or paste your coded message into the left box. Select the correct key numbers then press "Decode" to reveal the hidden message.
So first, write the very first character of the encoded string and remove it from the encoded string then start adding the first character of the encoded string first to the left and then to the right of the decoded string and do this task repeatedly till the encoded string becomes empty.
The decoding of a message is how an audience member is able to understand, and interpret the message. It is a process of interpretation and translation of coded information into a comprehensible form.
Try with htmlspecialchars_decode
echo htmlspecialchars_decode('http://mysite.com/?p=welcome&x=1&y=2');
//"http://mysite.com/?p=welcome&x=1&y=2"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With