#1
  1. No Profile Picture
    bizshop
    Guest
    Devshed Newbie (0 - 499 posts)
    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
  2. #2
  3. No Profile Picture
    moderator
    Guest
    Devshed Newbie (0 - 499 posts)
    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]
  4. #3
  5. No Profile Picture
    bizshop
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanks! Solution one worked (so I didn't try solution two.)

Similar Threads

  1. Windows 2000 Professional Terminal Services.
    By pablo_1999 in forum Windows Help
    Replies: 2
    Last Post: April 16th, 2004, 05:31 PM
  2. windows 2000 share fax printer on xp
    By zjye in forum Windows Help
    Replies: 0
    Last Post: February 17th, 2004, 04:46 AM
  3. Replies: 2
    Last Post: January 30th, 2004, 12:02 AM
  4. Windows XP CD won't boot.
    By Likki in forum Windows Help
    Replies: 2
    Last Post: January 12th, 2004, 06:32 PM
  5. Extended characters (&# codes) don't work in FPDF...
    By 80sDweeb in forum PHP Development
    Replies: 0
    Last Post: January 2nd, 2004, 12:44 PM

IMN logo majestic logo threadwatch logo seochat tools logo