Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006

    Unanswered: Inserting a blank line using fwrite

    Here is a piece of my code

    while ($data = fgetcsv ($fp, 1000)) {
    $num = count ($data);
    for ($c=0; $c < $num; $c++) {
    $mult[$row][$c] = $data[$c].",";
    //$mult[$row][$c] = $data[$c]
    fwrite($fp1, $mult[$row][$c]);
    $row ++;

    I need to insert a blank line after each iteration of 'c' loop. ie., when the 1st iteration of the c loop exits, I need to insert a blank line and continue doin the same.

    Any inputs?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    have you tried the new line symbol \n

    $mult[$row][$c] = $data[$c].",\n";
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2006
    I realize tht this is a stupid qstn, tht i posted in a hurry!
    It does work!
    but i used fwrite($fp,"\n");

    Thnx for the reply, anyway!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts