note 20435 added to function.sizeof

From: Date: Wed, 03 Apr 2002 18:42:56 +0000
Subject: note 20435 added to function.sizeof
Groups: php.notes 
Request: Send a blank email to php-notes+get-28552@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 :-) -- http://www.php.net/manual/en/function.sizeof.php http://master.php.net/manage/user-notes.php?action=edit+20435 http://master.php.net/manage/user-notes.php?action=delete+20435 http://master.php.net/manage/user-notes.php?action=reject+20435

« previous php.notes (#28552) next »