note 20434 deleted from function.sizeof by jimw
| From: | jimw@php.net | Date: | Wed, 03 Apr 2002 18:57:45 +0000 |
| Subject: | note 20434 deleted from function.sizeof by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28560@lists.php.net to get a copy of this message | ||
well, i have to say it was challenging to make this file work...it has to read the lines that end
with "\n" and are strings separated by "|"..i need to count the lines so i could
assign an id to each new line that would auto increment.
yes yes....i know mysql would be so much easier...but many people im making this for don't
mysql so i had to resort to file's :-( .. well this is what i finally got to work..
<?php
$fd = fopen ("file.db", "r");
$count = 0;
while (!feof ($fd)) {
$count++;
$buffer[$count] = fgets($fd, 4096);
$line = explode("|", $buffer[$count]);
echo "$line[0] | $line[1] | $line[2] | $line[3] | $line[4]<br>";
}
fclose ($fd);
?>
i used some cgi methods in that..but hey, they work :-)