What is MySQL's text field's NEWLINE characters? - need to replace it with a "<li>"

I am returning a MySQL database TEXT type field that might have paragraphs separated by lines. I don’t know if they are “/n” or “/r” or someother character.

I want to replace those characters by “</li><li>”. Then I’ll want to take out the last “<li>” from that string.

Something like:

str_replace(“/r”, “</li><li>”, $field);

What is the character I need to replace in the MySQL text field?



Well, actually that depends on what you inserted - it’s not defined by MySQL.

Odds are, it’s a newline, which is
(note the backslash, not a forward slash), but it all depends on how you formatted the text before inserting.

I tried it but found a work-around.

str_replace(“<br /><br />”, “</li><li>”, nl2br($field));

Since a line between paragraphs is comprise of 2 line breaks.

Thanks for your input!