PHP MySQL New Lines / Whitespaces from textarea

Posted by rob_robsen on Stack Overflow See other posts from Stack Overflow or by rob_robsen
Published on 2012-09-10T14:37:32Z Indexed on 2012/09/10 15:38 UTC
Read the original article Hit count: 210

Filed under:
|
|

I've a problem about whitespaces and new lines at the beginning of a textarea. I send a json string with ajax to the php script. Then I decode the string into an php array (with json_decode). So I have a string in this array with two line breaks at the beginning. If a print the text from the array, the line breaks are there, but if I store the text into the mysql database, the line breaks are gone... Only at the beginning of the string, the line breaks gone... At the rest of the string, the line breaks are ok.

Thanks for your answers! rob

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql