Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8423981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:52:06+00:00 2026-06-10T03:52:06+00:00

Regarding to fgetcsv() documentation, there are some parameteres inside fgetcsv() function: Handle, length, delimiter,

  • 0

Regarding to fgetcsv() documentation, there are some parameteres inside fgetcsv() function: Handle, length, delimiter, enclosure, and escape.

Now, I have 2 questions:

  1. What does enclosure do exactly?
  2. I have a csv file with 5 columns per line. Imagine it something like this: 1,2,3,4,5

So indexes are from 0 to 4. But whenever I want to get date from index 4, an empty value returns. Unless I put a comma after it (by filling an extra column after it that makes the contents like this: 1,2,3,4,5,6 ). How can I solve this issue ? It seems that there is some problem because of missing comma after the last item in each row of csv file!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:52:07+00:00Added an answer on June 10, 2026 at 3:52 am

     1. The enclosure parameter is the character the encapsulates the data for a specific field, or “index”. By default, the parameter is a ", which means that you can “enclose” strings in " characters.

    Example:

    1,2,"this is three",4
    

     2. Per a comment, you’re calling fgetcsv($handle, 10000, ','). It’s possible, maybe, that the line(s) you’re reading are longer than 10000 characters. Try changing the length to 0, which will be “no limit” and see if that helps. Another solution would be to try wrapping the column’s value in double-quotes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Regarding to jQuery utility function jQuery.data() the online documentation says: The jQuery.data() method allows
I am reading .csv file through PHP using fgetcsv(). Now I am able to
Regarding PHP security with cookies and sessions, this is what i have done so
Regarding separations of concerns only, are there advantages of using ASP.NET MVC instead of
Regarding this post and this other one . Suppose I have the following: public
Regarding the below code, how does the compiler choose which template function to call?
I'm trying to use fgetCsv but for some reason it is only reading the
How do I reset the file pointer with fgetcsv()? I have the loop below,
Regarding the backwards-incompatible change of Watir 0.5.x Finding elements by :class now matches partial
Regarding a line of this script: function Vehicle(hasEngine, hasWheels) { this.hasEngine = hasEngine ||

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.