September 1st, 2001, 09:09 PM
Suggestions most welcome!!!
September 1st, 2001, 09:22 PM
Lets say you want to display:
In html, to display that, you would have to write:
Using php to echo the html:
Hope this helps
September 1st, 2001, 09:40 PM
Or, display it in a text area.
<textarea name="ta1" rows="10" cols="50">
echo "<div>Hello World</div>\n";
Last edited by 7stud; September 1st, 2001 at 09:58 PM.
September 2nd, 2001, 12:35 AM
September 2nd, 2001, 01:01 AM
Last edited by 7stud; September 2nd, 2001 at 01:07 AM.
September 2nd, 2001, 01:06 AM
Last edited by jacobee; September 2nd, 2001 at 01:13 AM.
September 2nd, 2001, 01:10 AM
Well those <br> tags you are putting in the string aren't being run through html special characters are they? Furthermore, if I am a client of the poster, and I cut and paste your new string into my website, is it going to display the html?
September 2nd, 2001, 01:14 AM
Ok, I see what you are doing with the \r\n and <br> tags. Will someone cut and pasting the new string into their browser be able to have the html entities execute as html?
September 2nd, 2001, 01:16 AM
September 2nd, 2001, 01:17 AM
Ahhh...I think I understand now. Will the html entities display like html, but they don't execute?
September 2nd, 2001, 01:18 AM
For good measure you might want to stick the modified $code string inside of <pre></pre> in order to preserve any indenting and whatnot. What do you mean by "display like html"?
September 2nd, 2001, 01:22 AM
If you cut and pasted the output of what we're discussing you would get plain text with no html entities present.
September 2nd, 2001, 01:23 AM
Like the first reply said:
If you want this html to literally be displayed:
then you send the html entity version to the browser?
I think that must be it. Ok, then I have one suggestion to your suggestion, use str_replace() instead of the regexp, it's faster. Thanks for the lesson!
September 2nd, 2001, 01:25 AM
Thanks for the discussion - it's always fun.
Last edited by jacobee; September 2nd, 2001 at 01:29 AM.
September 2nd, 2001, 01:28 AM
I just tried it out. Thanks, that's pretty neat.