0

I have a bit of a problem. I am opening a file that has been exported from access with fopen(), reading it to a variable with fread() and then closing it. these files unfortunately have a LOT of blank lines. ex(one of them has over 50,000 blank lines). So i am trying to do a strreplace on the variable that contains the document, but i'm lost as to what string to search for.

Any help would be appreciated.

2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by donkey
0
$newstring = str_replace('\r\n', '', $string)

or

$newstring = preg_replace('/\r\n/i', '', $string);

If that doesn't work use \n without the \r

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.