0

First excuse for bad English, I'm French... ^^

When I use this :

$data ='aaaa'."\t".'bbbb'."\t".'cccc'."\t".'cccc'."\t".'dddd'."\t".'eeee'."\t".'ffff'."\t".'gggg'."\t".'hhhh'."\t".'iiii'."\t".'jjjj'."\t".'kkkk'."\t".'llll'."\t".'mmmm'."\r\n";

fwrite($myfile, $data);

Then open my file with Visual Studio Code, it tell me that I'm using LF but I need CRLF...

I tried with "\n" and PHP_EOL without sucess... I'm stuck...

Help please, thanks

Pascal
  • 25
  • 5
  • 3
    `\r\n` _is_ a CR/LF, don't see why that should write anything else into the file. Wild guess: You downloaded this file via FTP, to inspect what it contains? Then make sure you don't have any option to _convert_ line breaks between operating systems active in your FTP client. – CBroe Sep 22 '21 at 11:29
  • You downloaded this file via FTP, to inspect what it contains? > Yes I'm using FileZilla – Pascal Sep 22 '21 at 12:26
  • Then make sure that you set the transfer type to `Binary`, instead of `ASCII` or automatic. https://wiki.filezilla-project.org/Data_Type – CBroe Sep 22 '21 at 12:29
  • Yes you are right! FileZilla was set to Automatic instead of Binary (https://stackoverflow.com/questions/554960/how-can-i-stop-filezilla-changing-my-linebreaks) Thanks a lot – Pascal Sep 22 '21 at 13:09

0 Answers0