0

I have following string : src=//myServer.dev/test1/test2/loader.swf. Is it possible to transform this string in : %2F%%2F%myServer.dev%2Ftest1%2Ftest2%2Floader.swf ?

In fact I need to transform all special characters in their code. Help me

Mukesh
  • 7,630
  • 21
  • 105
  • 159
p3tos
  • 23
  • 1
  • 7
  • 5
    http://php.net/manual/en/function.urlencode.php – Damonsson Sep 09 '16 at 13:29
  • i think you look for htmlspecialchars : http://php.net/manual/en/function.htmlspecialchars.php ? – skank Sep 09 '16 at 13:29
  • [Take a look at this issue](http://stackoverflow.com/questions/14114411/remove-all-special-characters-from-a-string) I think this has been answered before – ajw4sk Sep 09 '16 at 13:30

1 Answers1

0

You can do this by using PHP's urlencode() method.

Chris Forrence
  • 10,042
  • 11
  • 48
  • 64
Remco K.
  • 644
  • 4
  • 19