标签:object art log isset 开始 class tmp set sse
1 $csv_file = ‘tmp.csv‘; 2 $start = isset($_GET[‘start‘]) ?intval($_GET[‘start‘]) : 1; // 从第几行开始读取 3 $num = 100; // 读取100行 4 $data = array(); 5 $spl_object = new SplFileObject($csv_file, ‘rb‘); 6 $spl_object->seek($start); 7 while ($num-- && !$spl_object->eof()) { 8 $data[] = $spl_object->fgetcsv(); 9 $spl_object->next(); 10 }
splFileObject 可以处理上M,G级别的数据.专门处理大数据文件的.
标签:object art log isset 开始 class tmp set sse
原文地址:http://www.cnblogs.com/300js/p/6118121.html