setting comma to fwrite output

Discussion in 'PHP' started by aln, Mar 21, 2009.

  1. aln

    aln New Member

    Joined:
    Mar 21, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    How to set comma in fwrite output like this ?
    PHP:
    <?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);
    ?>
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    48
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    PHP:
    fwrite($filea"$i,");
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice