Am I dreaming or do carriage returns prevent PHP versions from seeing a code line? -


i discovered code lines "cr" instead of "crlf" or "lf" @ end of line causing php behave weirdly, namely seeing 2 lines one, ignoring cr or, more accurately, interpreting is: carriage return not linefeed.

i had never had problem before but, lately, discovered notepad++ put cr when hit "enter" move new line... causes script behave badly.

for example, hello world script works fine when lines eneded lf or crlf crashes crs (at least replicate problem on both peer1 , hostgator servers -- else have different experience?)...

<?php header( "http/1.1 301 moved permanently" ); header( "location: http://www.cnn.com/" ); ?> 

and error:

fatal error: call undefined function phpheader() in /home/bernatch/public_html/test-redir-cr.php on line 1

obviously, php seeing <?php code , header function being on same line...

my question is: a) there way force php interpret single cr different line

or

b) there way force notepad++ put crlf or lf whenever press enter?

macs use cr. linux uses lf. windows uses cr-lf, odd windows operating system not insert lf after cr. maybe missing here.

edited on windows -> viewed on linux = ok

edited on windows -> viewed on mac = ok

so i'm guessing ftp client. make sure upload plain text files ascii, not binary.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -