Remove line break in fwrite

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
leosjcti
Forum Newbie
Posts: 1
Joined: Fri Sep 09, 2011 9:21 am

Remove line break in fwrite

Post 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 ..
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Re: Remove line break in fwrite

Post by ok »

What is the error message?
Post Reply