1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    PHP:
    fwrite($filea"$i,");
     

Share This Page