Re: Individual Lines of text
| From: | Justin Blake | Date: | Tue, 25 Sep 2001 02:13:41 +0000 |
| Subject: | Re: Individual Lines of text | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9502@lists.php.net to get a copy of this message | ||
> I am pulling down data from a switch which looks like
>
> Port 1, 33889029532
> Port 2, 0
> Port 3, 135852
> Port 4, 6652941243
> etc etc
>
> I need to know if it is possible with PHP to write a script that will pull
> the individual lines of this text file and store them into a mysql
database
> line by line.
You can read the entire text file to a string and then use explode() to
break it into an array using the newline character. Like this:
$array = explode("\n", $string);
That should make it easy to store it line by line to a dbase.
Justin -- http://blaix.org