I would like to get the last row of data using fgetcsv function

dmalovich
dmalovich used Ask the Experts™
on
I'm trying to parse a cvs file and I'm using fgetcsv.  I want to put the last row into an array.

while (($data = fgetcsv($fp, 1000, ",")) !== FALSE) {

        //put last row into array

}
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Just do a small change in your logic.

$lastrow;
while (($data = fgetcsv($fp, 1000, ",")) !== FALSE) {

       $lastrow = $data

}
// put last row into array.

Author

Commented:
Awesome, thanks....

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial