I know that you can count the number of lines with
$record = file($data_file); rsort($record); $total_lines = count($record); echo $total_lines;
Is there a way to count only lines with certain words and get a total?
for example I have a flat file with
What I'm trying to do is get a total of only eg
- or red and white
- or blue and white
Any help would be great.