I'm using PHP in order to insert data in an sqlite database.
I have a string like the following:
$string = "Good morning!<br />It is a wonderful day!<br />"
I would like to replace all occurrences of <br />
with \n
.
I did the following in PHP in order to replace the <br />
but it did not work:
<?php
$string = "Good morning!<br />It is a wonderful day!<br />"
$symbols =array('<br />');
$replace_symbols = array('\\n');
$string = str_replace($symbols, $replace_symbols,$string);
//InsertIntoSqlite($db,$string);
?>
When I connect to the sqlite database with SQLITE manager, I see the following inserted in the database:
sqlite: Good morning!\nIt is a wonderful day!\n
What can I do in order to fix that?
SOLVED:
I did the following:
<?php
$string = str_replace("<br />","\n",$string);
?>