Jump to content

PHP Data File Array Element Length


RichieW13

Recommended Posts

Is there any limit to the length of an array element in a flat data file?

 

For instance, I have a flat file that I might end up having 200 rows, with each row containing 15 elements.  Most of the elements will be about 20 characters or less, but a couple of the elements might be 300-400 characters.

 

I'm guessing there is no limit.

 

And since each row will be longer than one "line" in a .txt file, how best to mark the end of a row?

 

[i assume that using a database is probably the better way to do this, but on this particular website I'm working on that isn't an option.]

Link to comment
Share on other sites

http://en.wikipedia.org/wiki/Comma-separated_values

 

There is no (as far as i am aware) limit to the number of characters single line within a txt file. Therefore the end of the line can be found with

$lineValues = explode("\n",$txt);

 

So does that mean I should actually end each row with  \n in the text file?

 

like this:

2004,Ford,Escort,150000 miles\n

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.