Is there a way one can let a user manipulate text he/she may be typing via PHP? For example, the user may be able to make the text he/she has typed bold or even italicized. One can assume, that I am trying to get similar effects of this website. Is there a way to do this in PHP? I am trying to do this because once the user hits ‘submit’ after typing the textual information, the information will then be saved into a MySQL table. From where, I will at a later time, try to display the information. Therefore, it would be easy to retrieve text as the user had typed it (bold or even italicized). How does it work?
Thank you.
StackOverflow uses the Markdown language. There’s a PHP implementation of it here: http://michelf.com/projects/php-markdown/ and a JavaScript implementation here: http://attacklab.net/showdown/ or you can use the WYSIWYG control StackOverflow’s editing is based on: http://wmd-editor.com/
Basically it stores italics and bold (and other formatting like lists) as simple text with special formatting:
*italics* **bold**so that you can store that plain text in your database. Then it formats that before displaying it.(here’s the actual markdown project: http://daringfireball.net/projects/markdown/)