|
Posted by Dan Pearce on 06/21/06 15:15
I am formatting a plain text file into HTML and trying to find the
carriage returns with little success...
<?php
$s = file_get_contents('./test.txt')
$search = array ('\n\n');
$replace = array ('<p></p>');
echo preg_replace($search, $replace, $s);
?>
I have also tried \n, \r, \n\r etc... in place of \n\n but to no avail.
Can anyone help me with this? I know text files aren't an ideal format
and a database would be easier, but the site will be used by people
with no computer knowledge what so ever, and it is easier to show them
how to use notepad :¬)
Thanks in advance
Dan
Navigation:
[Reply to this message]
|