Go4Expert

Go4Expert (http://www.go4expert.com/)
-   PHP (http://www.go4expert.com/forums/php/)
-   -   setting comma to fwrite output (http://www.go4expert.com/forums/setting-comma-fwrite-output-t16610/)

aln 21Mar2009 09:54

setting comma to fwrite output
 
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);
?>


pradeep 21May2009 22:06

Re: setting comma to fwrite output
 
Code: PHP

fwrite($filea, "$i,");



All times are GMT +5.5. The time now is 08:35.