Thanks to all for your responses. I ended up using htmlentities. Thanks Stephen. Also, the reason I didn't use a premade editor is that I am planning on selling a web-editor system and don't want any troubles with licenses. <quote> Hi all! I am trying to make a PHP HTML editor. I have made the entire editor function, but it has a big problem. If the page contains a </textarea> tag, it ends the editor's textarea and the browser starts rendering the HTML. How do I go about preventing this from happening? Thanks a lot! --Zootboy </quote>