|
Posted by Dan Pearce on 07/05/06 13:57
Processing some text from an external text file into a web page. If I
use this:
<?
$s = file_get_contents('text.txt');
$search = array("@\r\n@si");
$replace = array('</br>');
echo preg_replace($search, $replace, $s);
?>
Explorer shows the text as it appears in the file;
This is some test text
This is some test text
This is some test text
This is some test text
but Firefox displays
This is some test textThis is some test textThis is some test textThis
is some test text
Now if I use
<?
$s = file_get_contents('text.txt');
$search = array("@\r\n@si");
$replace = array('<br></br>');
echo preg_replace($search, $replace, $s);
?>
The firefox output is correct but Explorer now double spaces everything
This is some test text
This is some test text
This is some test text
This is some test text
Any ideas on how to correct this? Thanks in advance for your time.
Dan
Navigation:
[Reply to this message]
|