Re: How to read a text file with variable line length?

From: Date: Mon, 08 Oct 2001 04:30:35 +0000
Subject: Re: How to read a text file with variable line length?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70317@lists.php.net to get a copy of this message
Use fgets() http://www.php.net/manual/en/function.fgets.php -Jason Garber www.IonZoft.com At 08:19 PM 10/7/2001 -0600, Carlos Fernando Scheidecker Antunes wrote:
Hello all, I would like to ask the following help concerning text files. I've got column delimited text files and I need to read each line/record to populate a MySQL table. I understand that when you use fread($file, $length) you must specify the length of each line. The problem is that the last column is a description column and it can be from zero chars to 50 chars long. Because of that the length of each line is not a fixed number. What to do in a situation like this? Thanks in advance, Carlos Fernando Scheidecker Antunes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#70317) next »