September 12th, 1999, 07:36 PM
-
Have a form that reads a file and presents it for editing in a <TEXTAREA> window. Then saves the data using PHP fwrite. However, if somebody is using a Windows machine when using the form, the resulting file has ^M on the end of each line. Any ideas on how to solve this or get rid of these characters?
Try the script if you are using Windows at bizshop.com/php/choosefile.phtml
September 17th, 1999, 10:43 AM
-
I believe that Windows uses 'rn' as a EOL character and UNIX machines only use a 'n' character for an EOL.
You may be able to do something like this to remedy the problem:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?
$fileOutput=ereg_replace("rn","n",$fileOutput;
?>
[/quote]
Or perhaps this would work:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?
$fileOutput=ereg_replace(13,"n",$fileOutput);
?>
[/quote]
September 17th, 1999, 10:49 AM
-
Thanks! Solution one worked (so I didn't try solution two.)