0

Hi I need to encode something like this ,

< html>< body>foo< /body>< /html>

into something like this

data:text/html;charset=utf-8,%3Chtml%3E%3Cbody%3Efoo%3C/body%3E%3C/html%3E

I am not sure how to explain this but I need it for doing something like this.
Html code as IFRAME source rather than a URL

and I need a php function to do so.
Thanks in advance .

Community
  • 1
  • 1
Kartik Prasad
  • 730
  • 7
  • 18
  • `rawurlencode`. Also, you can indent code with four spaces to make it render like this: ``, and then you won't need the extra spaces to keep the tags visible. – Jon Aug 09 '13 at 08:59

1 Answers1

1

Take a look at : rawurlencode it encodes the given string according to » RFC 3986.

robinef
  • 312
  • 1
  • 7