setting comma to fwrite output

aln's Avatar, Join Date: Mar 2009
aln
Newbie Member
How to set comma in fwrite output like this ?
PHP Code:
<?php
$filea 
fopen('filea.txt''wb');
$fileb fopen('fileb.txt''wb');

for(
$i 1$i <= 100$i++)
{
    if(
$i 2)        
fwrite($filea$i);
    else        
fwrite($fileb$i);
}

fclose($filea);
fclose($fileb);
?>
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Code: PHP
fwrite($filea, "$i,");