I have a html / php page that receives data in a textarea and saves it to a mysql database.
Sometimes the user uses line break in their text and saves in the good bank.
I also have a php page that converts any record to json, link , which can be read for an android app I'm developing.
However, when there is a line break, the app gives json reading problems.
If you click the link above, you will see that the value of the descricao
key is like this: Tudo em moda masculina. Os melhores preços você encontra aqui! Venda via Instagram.
Here it does not show, but after the exclamation, there is a line break before the text 'Sale via Instagram'. It is not easy to solve, because I do not know how to "catch" this line break
How to do in php to ignore the line break in a mysql database when generating a echo
, eg:
echo semQuebraDeLinha($linha['dado']);