You are here: reading the correct line sequence from a txt file « PHP Programming Language « IT news, forums, messages
reading the correct line sequence from a txt file

Posted by programming on 04/10/07 07:52

Is there any reason why i am NOT reading each invididual line from a
txt file in this script...e.g i keep on getting 2 lines printed outed
when there are clearly
four lines in the txt file.

also, is my counter right here?

<? php
$listf = fopen ("./member.txt", "r");
# read the file
$line = fgets($listf, 4096);


while(($data = fgetcsv($listf,1024,"|"))!=FALSE)
{
$count++;
$duserid=trim($data[0]);
$dname=trim($data[1]);



list ($duserid,$dname,$actions) = split("\|",$line);
$line = chop($line); //chops space out of program

$actions= "<a href=\"./delete_member.php?record_id=29\">Delete</a> |
<a href=\"./edit_member.php?record_id=29\">Edit</a></td>";
$data = fgetcsv($listf, 1024);
echo "<tr><td>$duserid</td><td>$dname</td><td>$actions<td></tr>";

}

fclose($listf);
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация