protected function readHeaderRow($rowNumber)
    {
        $this->file->seek($rowNumber);
        $headers = $this->file->current();

        // Test for duplicate column headers
        $diff = array_diff_assoc($headers, array_unique($headers));
        if (count($diff) > 0) {
            switch ($this->duplicateHeadersFlag) {
                case self::DUPLICATE_HEADERS_INCREMENT:
                    $headers = $this->incrementHeaders($headers);
                    // Fall through
                case self::DUPLICATE_HEADERS_MERGE:
                    break;
                default:
                    throw new DuplicateHeadersException($diff);
            }
        }

        return $headers;
    }
protected function readHeaderRow($rowNumber)
    {
        $this->file->seek($rowNumber);
        $headers = $this->file->current();

        // Test for duplicate column headers
        $diff = array_diff_assoc($headers, array_unique($headers));
        if (count($diff) > 0) {
            switch ($this->duplicateHeadersFlag) {
                case self::DUPLICATE_HEADERS_INCREMENT:
                    $headers = $this->incrementHeaders($headers);
                    // Fall through
                case self::DUPLICATE_HEADERS_MERGE:
                    break;
                default:
                    throw new DuplicateHeadersException($diff);
            }
        }

        return $headers;
    }
protected function readHeaderRow ( $ rowNumber ) { $ this -> file -> seek ( $ rowNumber ) ; $ headers = $ this -> file -> current ( ) ; // Test for duplicate column headers $ diff = array_diff_assoc ( $ headers , array_unique ( $ headers ) ) ; if ( count ( $ diff ) > 0 ) { switch ( $ this -> duplicateHeadersFlag ) { case self :: DUPLICATE_HEADERS_INCREMENT : $ headers = $ this -> incrementHeaders ( $ headers ) ; // Fall through case self :: DUPLICATE_HEADERS_MERGE : break ; default : throw new DuplicateHeadersException ( $ diff ) ; } } return $ headers ; }
Read header row from CSV file

@param integer $rowNumber Row number

@return array

@throws DuplicateHeadersException
Read header row from CSV file