Re: Lines of txt

From: Date: Fri, 28 Sep 2001 01:38:48 +0000
Subject: Re: Lines of txt
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-69091@lists.php.net to get a copy of this message
hi devon- here's an example that might help : $file = '/www/htdocs/foo.txt'; if (file_exists($file)) { $lines = file($file); foreach ($lines as $line) { echo $line; } } of course you'll insert $line into your database instead of echo'ing it. regards, Philip Olson On Fri, 28 Sep 2001, Devon wrote: > Below is my source that sipply opens a file > > <?php > $fp = fopen ("http://localhost/Install.txt", > "r"); > if ($fp) > { print"The file exists!"; } > else > { print"The file does not exist"; } > ?> > > I Need to be able to a. print the file out b. The file must be printed out > line by line c. Write each seperate line to a mysql data base in different > tables. > > Any help would be awsome > Cheers > > > > -- > 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 (#69091) next »