Page 1 of 1

Remove line break in fwrite

Posted: Fri Sep 09, 2011 9:28 am
by leosjcti
Hello everyone. I'm sorry for english
I have a code that generates a txt file based on several queries that do the flock ... these queries and then I generate the file that way.

Code: Select all

$cria = fopen("Cartao.txt", "a");
                                
$dados = "$nome";
$dados .= "$nome_tit";
$dados .= "$nomeempr";
$dados .= "$cod_usu";
....

$escreve = fwrite($cria, "$dados $carencia_oficial\r\n");
So nice work .. correctly, with a line break in each record ...
But when I put just one more variable.

Code: Select all

$escreve = fwrite($cria, "$dados $carencia_oficial $teste\r\n");
it does not work .. he plays bass line for the record that would have come on the same line? 'm doing something wrong?

Thanks guys ..

Re: Remove line break in fwrite

Posted: Fri Sep 09, 2011 9:42 am
by ok
What is the error message?