On 7/29/09 3:16 PM, "Jim Lucas" <li...@cmsws.com> wrote:

Miller, Terion wrote:
>
>
> On 7/29/09 3:05 PM, "Jonathan Tapicer" <tapi...@gmail.com> wrote:
>
> On Wed, Jul 29, 2009 at 4:20 PM, Miller,
> Terion<tmil...@springfi.gannett.com> wrote:
>>
>>
>> On 7/29/09 1:45 PM, "Ashley Sheridan" <a...@ashleysheridan.co.uk> wrote:
>>
>> [snip/]
>>
>> Have you thought of just using a regular str_replace() on your code? You
>> can ask it to replace newlines and carriage returns with nothing and see
>> if that fixes you problem?
>>
>> Thanks
>> Ash
>> www.ashleysheridan.co.uk
>>
>>
>>
>> Yep I have tried str_replace to get rid of \n and it didn't work
>> Boss mentioned to explode the var that is full of so many blank lines then 
>> put it back together..seems like there has to be an easier way...
>>
>> This is what I tried:
>>
>>     $tags = array('\n', '<br>');    $sNotes = str_replace($tags,"", $notes);
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> That didn't work because \n needs to be between " " instead of ' '.
>
> Jonathan
>
>
> Thanks Guys, ended up using Jim's way before inserting it into the db and it 
> works like a charm
>
>

Just to be clear.  Can you paste which one worked for you.

This is what worked....on my page that inserts the data to the db I put

 //stripping white line spaces    $cleanNotes = preg_replace('|\s+|', ' ', 
$notes);    $cleanVios = preg_replace('|\s+|', ' ', $cleanViolations);

then I mysql_escaped them and put them in the db, checked the csv and presto 
perfect no extra linespacing


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to