public function filterFileData(array $fileHeaders, array $rawStockistData)
    {
        $rowCount=0;
        $rawDataRows = [];
        
        foreach ($rawStockistData as $rowIndex => $dataRow) {
            
            // skip headers
            if ($rowIndex == 0) {
                continue;
            }
            // skip empty rows
            if (count($dataRow) <= 1) {
                unset($rawStockistData[$rowIndex]);
                continue;
            }
            /* we take rows from [0] = > value to [website] = base */
            if ($rowIndex > 0) {
                foreach ($dataRow as $rowIndex => $dataRowNew) {
                    $rawDataRows[$rowCount][$fileHeaders[$rowIndex]] = $dataRowNew;
                }
            }
            $rowCount++;
        }
        return $rawDataRows;
    }
public function filterFileData(array $fileHeaders, array $rawStockistData)
    {
        $rowCount=0;
        $rawDataRows = [];
        
        foreach ($rawStockistData as $rowIndex => $dataRow) {
            
            // skip headers
            if ($rowIndex == 0) {
                continue;
            }
            // skip empty rows
            if (count($dataRow) <= 1) {
                unset($rawStockistData[$rowIndex]);
                continue;
            }
            /* we take rows from [0] = > value to [website] = base */
            if ($rowIndex > 0) {
                foreach ($dataRow as $rowIndex => $dataRowNew) {
                    $rawDataRows[$rowCount][$fileHeaders[$rowIndex]] = $dataRowNew;
                }
            }
            $rowCount++;
        }
        return $rawDataRows;
    }
public function filterFileData ( array $ fileHeaders , array $ rawStockistData ) { $ rowCount = 0 ; $ rawDataRows = [ ] ; foreach ( $ rawStockistData as $ rowIndex => $ dataRow ) { // skip headers if ( $ rowIndex == 0 ) { continue ; } // skip empty rows if ( count ( $ dataRow ) <= 1 ) { unset ( $ rawStockistData [ $ rowIndex ] ) ; continue ; } /* we take rows from [0] = > value to [website] = base */ if ( $ rowIndex > 0 ) { foreach ( $ dataRow as $ rowIndex => $ dataRowNew ) { $ rawDataRows [ $ rowCount ] [ $ fileHeaders [ $ rowIndex ] ] = $ dataRowNew ; } } $ rowCount ++ ; } return $ rawDataRows ; }
Filter data so that it will skip empty rows and headers

@param   array $fileHeaders
@param   array $rawStockistData
@return  array
Filter data so that it will skip empty rows and headers