Quote:
Originally Posted by nico_swd
Remove the "carriage return" characters as well.
PHP Code:
$test1= ereg_replace("[\r\n]+", 'YEA', $myvalues);
|
Thank You, that was the problem!
My Test Code:
PHP Code:
<?php
$myvalues = 'cars
trucks
automobiles';
echo 'DATA IN<br />';
echo nl2br($myvalues) . '<br />';
echo '<br />TEST 2<br />';
$test2 = str_replace("\n", "GO", $myvalues);
echo nl2br($test2) . '<br />';
echo '<br />TEST 3<br />';
$test3= str_replace("\r\n", "NO", $myvalues);
echo nl2br($test3) . '<br />';
echo '<br />TEST 4<br />';
$test4 = str_replace("\r\n", "", $myvalues);
echo nl2br($test4) . '<br />';
?>
OUTPUT:
Quote:
DATA IN
cars
trucks
automobiles
TEST 2
cars
GOtrucks
GOautomobiles
TEST 3
carsNOtrucksNOautomobiles
TEST 4
carstrucksautomobiles
|
That is exactly what I needed! This is the second time you saved me, I really appreciate your help!