www.webdeveloper.com
Results 1 to 4 of 4

Thread: How To set Column limit in csv file?

  1. #1
    Join Date
    Aug 2014
    Location
    Banglor
    Posts
    7

    How To set Column limit in csv file?

    How To set Column limit in csv file?

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    859
    Do you think you can be more detailed in your request for help? Really!

  3. #3
    Join Date
    May 2014
    Posts
    77
    Quote Originally Posted by Krunal View Post
    How To set Column limit in csv file?
    I guess if you mean to move on from one column, into the next column, you just add a comma ",".
    If it's the last column in the row and you want a new row, just add a new line:

    PHP Code:
    echo "column 1 data";
    echo 
    "," end column 1start column 2
    echo "column 2 data";
    echo 
    "\n"// This ends a row
    echo "column 1 data for row 2";
    echo 
    "," end column 1start column 2
    echo "column 2 data for row 2";
    echo 
    "\n"// This ends a row 
    If that's not what you're asking... I have no idea what you're asking. A csv is just text separated by commas and new lines.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,537
    If using fgetcsv() and fputcsv(), you are dealing with arrays. Whichever direction you are going (getting or putting), you can use array_slice() to limit the number of elements in the array.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles