PHP flat file rows? PHP programmers help!?

  • Thread starter Thread starter youknowxthatkidd
  • Start date Start date
Y

youknowxthatkidd

Guest
I use flat files for my scripts (i do not have access to SQL databases).
Here is my text file: members.txt

1\|John\|Photoshop
2\|Riley\|Photoshop
3\|Nicole\|Dreamweaver
4\|Raymond\|Flash
5\|Nathan\|Photoshop

My question is this:
EG: How can I could the number of lines whos third field is Photoshop
only count those lines, not the ones that have dreamweaver of flash, etc. just count the fields that say Photoshop
Heres the code I use to read the file:

define(MEMBERS, "members.txt");

$dbFile = file(MEMBERS);
// Each row
foreach($dbFile as $row) {
list($id, $name, $program) = explode("\|", $row);
echo $name."<br />".$program."<br /><br />";
}
 
Back
Top