PHP - SPL file object returning null on seek -


alright, using spl file object a+ mode. data apends correctly want validate last row of data grabbing file again. data csv format, works first line in file , apends 2 line correctly. when seeking 2nd line returns null.

<?php  $handle = new splfileobject("filepath here","a+"); $handle->setflags(splfileobject::read_csv);  // write using fputcsv $status = $handle->fputcsv($data,','); $status = $handle->fputcsv($data,','); $handle->seek(1); $fields = $handle->fgetcsv(','); $fields2 = $handle->current(); 

// both fields , fields2 return null

there 2 lines worth of data in file. please help


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -