Quote:
Originally Posted by nico_swd
It's \n and not /n... (backslash). And it should go between double quotes.
|
Well, I am closer but the darned line break remains in the code
I have also been trying to do the same thing with "str_replace" so I used that in my test code too.
Here is my test code:
PHP Code:
<?php
$myvalues = 'cars
trucks
automobiles';
echo 'DATA IN<br />';
echo nl2br($myvalues) . '<br />';
echo '<br />TEST 1<br />';
$test1= ereg_replace("\n", 'YEA', $myvalues);
echo nl2br($test1) . '<br />';
echo '<br />TEST 2<br />';
$test2 = str_replace("\n", "GO", $myvalues);
echo nl2br($test2) . '<br />';
?>
Here is the output:
Quote:
DATA IN
cars
trucks
automobiles
TEST 1
cars
YEAtrucks
YEAautomobiles
TEST 2
cars
GOtrucks
GOautomobiles
|
Perhaps I am going about this wrong? I just want to kill those nastly little line breaks :erm: