Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm so confused with a strange behaviour. Actually I have edited some php files remotely with my PhpDesigner8 (a php editor). Everything goes right, but when my teammates reopen the files that I have edited the source code have blank lines like below:

class AdminController extends Controller

{

    function __construct()

    {

        parent::__construct();



        if (!$this->session->can_admin())

        {

            show_error('Solo para administradores.');

        }

        $this->load->library('backend');

    }

}

Instead of

class AdminController extends Controller
{
    function __construct()
    {
        parent::__construct();
        if (!$this->session->can_admin())
        {
            show_error('Solo para administradores.');
        }
        $this->load->library('backend');
    }
}

Did you have experience these kinds of problems?

share|improve this question

closed as off topic by Su', John Conde Oct 6 '12 at 22:45

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

1 Answer

up vote 3 down vote accepted

This is the standard line ending issue.

On Unix, line endings end with LF ("\n"), while Dos and Windows machines used a CRLF combination ("\r\n"). If your editor is changing the line endings as it writes files, the other system won't automatically adjust that.

On the opposite end, older versions of Windows Notepad doesn't recognize line endings from Unix systems, and places everything into one large line.

share|improve this answer
    
I got it! So, I think that I need to set the "end line caracter" in my phpEditor, right? –  manix Oct 6 '12 at 16:13
    
Yep.. You was correct. I set the value File format from windows to UNIX and it works! Thank you! –  manix Oct 6 '12 at 16:30
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.