1

How can I have PHP display this URL correctly?

Is there a working encoding method I can use that converts all of

253A%252F%252F

to

://

in

https%253A%252F%252Fvideos-private.s3.amazonaws.com%252Flesson05.flv

?

3 Answers 3

6

You should use double urldecode, i.e.,

$beuty_url = urldecode(urldecode("https%253A%252F%252Fbassrxprivate.s3.amazonaws.com%252Flesson05.flv"));
echo $beuty_url;
Sign up to request clarification or add additional context in comments.

1 Comment

Why double 'urldecode'? It sounds counterintuitive. It also seems to contradict the other answers. What is the explanation?
3

urldecode ;)

1 Comment

I was expecting this to work but it doesn't. Please advise! Thank you. $output = "file=https%253A%252F%252Fbassrx-private.s3.amazonaws.com%252Flesson05.flv" $flv = urlencode ($output); echo urlencode ($flv);
0

The urldecode function decodes any %## encoding in the given string. In your "output" string you have %253A and so on. Remove those %25 and everything will be fine.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.