How to save sqlite strings in php

I managed to get new rows in my sqlite database using quotes around the column entries

"start

end"

but when I request it in php, all my newline lines disappear!

start end

How can I save my lines?

+4
source share
1 answer

nl2br

The php documentation for nl2br states:

nl2br - Insert HTML line breaks before all newlines in a line

with an example:

Example # 1 Using nl2br ()

<?php
echo nl2br("foo isn't\n bar");
?>

The above example outputs:

foo isn't<br />
 bar

just add nl2br after your echo:echo nl2br(.....);

+3
source

Source: https://habr.com/ru/post/1661788/


All Articles