在批量处理php中的批量csv

I have a csv file with more than 34000 rows. How could I process (do some operations) with this csv as batches. I mean I have to take first 100 rows and process that, then the next 100 and so on with in a single function call

Load it into an array, then process it in batches of 100 as such (UPDATED):

$myArray = getCSV("filename.csv");
$allRows = $myArray.count();
while ($allRows > 0) {
    for ($x = 0; $x < 100; $x++) {
        { do your code here }
        $allRows--;
        if ($allRows == 0) $x = 100; // fall out of for loop
    }
}

....

function getCSV($file) {
    ini_set('memory_limit', '1024M'); // set high in case file is really big
    $arrResult = array();
    $arrFile = file($file);
    $foreach($arrFile as $line) {
        $arrResult[] = explode(',', $line);
    }
    return $arrResult;
}