Jump to content

Count Suggestions


Schlo_50

Recommended Posts

Hi there,

 

I am working on a script of mine, and one of the requirements is that I need to find the last row of a list I have stored as a .DAT and count the number of values in the row.

 

I can find the last row but am wondering if someone could point out how i'd count the values. For instance my .DAT may look like the following: (I need to find out how many values are in the bottom row.)

 

ID|Email|Name|Description      (4 values are in this row)

ID|Email|Description              (3 values are in this row, which is the one I need the sum of)

 

Can someone help please?

The code I have so far finds the last row.

 

$lines = file("./admin/data/candidates.DAT");
$last = $lines[count($lines)-1];
unset($lines);

$vals = explode("|", $last);

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/109715-count-suggestions/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.