Are these characters carriage returns? They appear if either the file has not correct line endings like CRCRLF or you have the wrong settings.
I suggest following settings in the File Handling
configuration page:Conversions - On Paste convert line ending to destination type (UNIX/MAC/DOS)
should be set.DOS/UNIX/MAC Handling - Automatically convert to DOS format
should be selected.Save - Save file as input format (UNIX/MAC/DOS)
should be checked.
Now while editing the file is always a DOS file (lines terminated with CRLF) which is still the best at Windows OS, but are saved in the same format (DOS, UNIX or MAC) as it was before opening the file.
If this does not fix your problem, then your files are already corrupted. Search for ^r^r^n
and replace it with ^p
to fix it. Switch to hex mode to see how the lines of your files are terminated. CR has hex code 0D and LF has hex code 0A. 0D 0D 0A is bad and also 0A 0D 0A if no 0D is before first 0A. Bad LFCRLF without a CR before first LF can be also fixed, but only with a regular expression replace or in hex mode.
How do you upload/download your PHP files to/from the server which I guess is a Unix server? In binary or in ASCII mode?
The ASCII mode is only necessary if you have your PHP files on your harddisk in DOS format (CRLF). So the FTP program has to convert all CRLF to LF during upload and all LF to CRLF during download. If your files are already stored on your harddisk in UNIX mode (LF only) the binary mode should be used for the FTP transfer.
For more infos see also forum topic ASCII DOS Unix File format settings