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
https://forums.phpfreaks.com/topic/246288-php-data-file-array-element-length/
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);

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.