grnadpa — 2013-06-19T18:46:57-04:00 — #1
Seems to me a sitepoint author (Kevin Yank?) wrote a function that would generate html from a text file looking for "\r" or "\ " or both -- converting them into "<p>" or "<br>" [obviously before xhtml].
I can't find that function. And, in any case, would like to extend it to handle italics and bold using an OpenOffice text file (.odt) source.
I know there are "free" converters out on 'net -- but they require email address and cookies permissions -- I'd just as soon not (PRISM not withstanding).
Anyone got such an animal?
marplo — 2013-06-20T03:45:34-04:00 — #2
You can use str_replace() to convert "\r" and "t" into <br/>.
$str = "Some tet.\\r Other text.\ And so on ...";
$str2 = str_replace(array("\\r", "\ "), '<br/>', $str);