faqts : Computers : Programming : Languages : PHP : Common Problems : Files

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 56 people (11%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How can I split text files if the are very long?

Jul 17th, 2000 10:34
Matt Gregory, Max Brown, unknown unknown,


I'm assuming from your questions that you are planning to dump the text 
into varchar or blob fields in a mySQL or Oracle database?
If this is what you are planning then your best bet is to open the file 
with the fopen function, read up to your maximum field size from the 
file into the variable, and then repeat as desired until you save the 
entire file or as much as you wish inserted into the database.