[My EDITED New Question]
I am taking text input in HTML form as . Suppose the user entered the following text:
I think you can store with utf_encode(). and get it with utf_decode(). You can see the n12br function of PHP.
utf_encode()
utf_decode()
n12br
-- EDIT --
I encrypt using base64_encode() and to get I use base64_decode(). Tabs, spaces and special characters are preserved.
base64_encode()
base64_decode()