Re: arrays
| From: | Andrey Sosnitsky | Date: | Mon, 23 Sep 2002 08:10:27 +0000 |
| Subject: | Re: arrays | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21923@lists.php.net to get a copy of this message | ||
Hello, roslyn.
You wrote 23 сентября 2002 г., 11:51:02:
Try file() function "file -- Reads entire file into an array".
See manual at http://www.php.net/manual/en/function.file.php
for
details.
rj> hello,
rj> im not sure of how to create a 1-d array. i want to read a text file and put each line into
rj> an array, i wrote the following piece of code but got errors,
rj> <?php
rj> $conn=pg_connect("host=abcd/djkfhjd/ dbname=ucs user=roslyn password=roslyn");
rj> $filename="note.txt";
rj> $fp = fopen ($filename,"r");
rj> $len=filesize($filename);
rj> while (!feof ($fp))
rj> {
rj> $buffer = fgets($fp,$len);
rj> $charcs= array($buffer);
rj> echo "$charcs <br>";
rj> }
rj> fclose($fp);
www.pskov.ru webmaster|programmer|DBA
www.invest.pskov.ru
www.education.pskov.ru
--
Best Regards,
Andrey mailto:andrey@pleskov.ru