At 20:36 24.03.2003, Mike Zornek said:
--------------------[snip]--------------------
>I'm writing a little script that is parcing a excel generated csv file.
>While all the users will be using windows I'd like to make it safe for all
>file types.
>
>Any one have a quick snippet that I could use to convert a temp file to use
>all \n based line endings for consistency?
--------------------[snip]-------------------- 

$in = array("/\n\r/", "/\r\n/", "/\r/");
$out = array("\n", "\n", "\n");
$cleaned = preg_replace($in, $out, $dirty);


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



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

Reply via email to