NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #198 most downloaded on Packagist
CSV data manipulation made easy in PHP
Last release 9 months ago
27 Dec 2025
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
83 releases · first in 2013
EnumFormatter to format Enum for CSV serialization
EnumFormatter to format Enum for CSV serializationThis is the last version supporting PHP8.1
AbstractCsv::download improved implementation see # 569
One column per quarter.
AbstractCsv::from and AbstractCsv::fromString to simplify instantiating Reader and Writer instance.
AbstractCsv::from and AbstractCsv::fromString to simplify instantiating Reader and Writer instance.Stream::from and Stream::fromString to simplify internal instantiation of Stream instances.AbstractCsv::createFromString use AbstractCsv::fromString insteadAbstractCsv::createFromStream use AbstractCsv::from insteadAbstractCsv::createFromFileObject use AbstractCsv::from insteadStream::createFromResource use Stream::from insteadStream::createFromString use Stream::fromString insteadJsonFormat::NdJsonHeader and JsonFormat::NdJsonHeaderLess
JsonFormat::NdJsonHeader and JsonFormat::NdJsonHeaderLessJsonConverter conversion methods accept an optional $header parameter to handle the new JSON formats.Writer::insertAll and converter classes convert methods now accept TabularData and TabularDataProvider implementing classesWarning class to fix warnings triggering in the codebase.chunkSize usage when NDJson is generated by the JsonConverter class.application/x-ndjson.JsonFormat Enum to allow exporting to JsonLines with the JsonConverter object.
JsonFormat Enum to allow exporting to JsonLines with the JsonConverter object.TabularDataProvider interface to allow connecting to the package features without implementing all the methods.PHP8.5 in github actionsDOMDocument::createTextNode() receives a string #567 by serpentbladeFix possible memory leaks with the Writer class #563 - thanks to pope-12
TabularData::last and TabularData::lastAsObject
TabularData::last and TabularData::lastAsObjectAbstractCsv::download methodTypeCastingInfo to improve error message when type casting fails during denormalization #561
ResultSet::__construct is marked as being internal and deprecated before being made private use ResultSet::from
Writer::necessaryEnclosureTabularDataReader::selectAllExceptStatement::selectAllExceptResultSet::from and ResultSet::tryFromRdbmsResult class to ease importing RDBMS result into the package classesTabularData interfaceBuffer classXMLConverter::supportsHeaderXMLConverter::whenHTMLConverter::whenJsonConverter::whenCharsetConverter::appendOnReadTo, CharsetConverter::appendOnWriteTo, CharsetConverter::prependOnReadTo, CharsetConverter::prependOnWriteToWriter::relaxEnclosure use Writer::necessaryEnclosureResultSet::createFromTabularDataReader use ResultSet::fromResultSet::createFromRecords use ResultSet::fromResultSet::__construct is marked as being internal and deprecated before being made private use ResultSet::fromXMLConverter::convert use XMLConverter::import insteadXMLConverter::create use XMLConverter::__construct insteadHTMLConverter::create use HTMLConverter::__construct insteadStatement::create use Statement::__construct insteadFragmentFinder::create use FragmentFinder::__construct insteadCharsetConverter::appendTo, CharsetConverter::prependTo use the more strict methods added on the instanceComparison::CONTAINS must check the value is a string before calling str_compare #548 by cage-isBom::tryFromSequence and Bom::fromSequence supports the Reader and Writer classes.XMLConverter::$formatter should not be public.XMLConverter internal rewritten to take advantage of PHP8.4 new dom classesHTMLConverter internal rewritten to take advantage of PHP8.4 new dom classesXMLConverter::fieldElement now has a nullable field element to allow using headers names as cell names.AbstractCsv::appendStreamFilterOnRead
TabularDataReader::map method.StreamFilter classCallbackStreamFilter classAbstractCsv::appendStreamFilterOnReadAbstractCsv::appendStreamFilterOnWriteAbstractCsv::prependStreamFilterOnReadAbstractCsv::prependStreamFilterOnWriteStream::getMode returns the underlying stream mode; internal codebase.AbstractCsv::addStreamFilter use AbstractCsv::appendStreamFilterOnRead or AbstractCsv::appendStreamFilterOnWrite instead.CharsetConverter and SwapDelimiter internal code.supportStreamFilterOnReadand supportStreamFilterOnWrite to expose the document real stream filter capabilities.Fix Statement callback and closure signature
JsonConverter::formatter now accepts callable before only Closure where accepted.
XMLConverter::formatterHTMLConverter::formatterWriter::encloseNoneWriter::encloseNecessaryWriter::noEnclosureJsonConverter::formatter now accepts callable before only Closure where accepted.Writer::$enclose_all is no longer a boolean but an integerUsing PHP8.4 Deprecated attribute to signal deprecated public API methods and constants.
JsonConverter::withPrettyPrint now accepts an optional $identSize parameter as its unique parameter.Statement::when to enable conditionable query building.Deprecated attribute to signal deprecated public API methods and constants.JsonConverter::indentSizecallable in the Query\Constraint namespace.HttpHeaders::forFileDownload to be inline with RFC2183 and HTTP field name and value best practices.League\Csv\JsonConverter::chunkSize
League\Csv\JsonConverter::chunkSizeLeague\Csv\AbstractCsv::downloadLeague\Csv\AbstractCsv::output use League\Csv\AbstractCsv::download insteadLeague\Csv\FragmentFinder and derived methods are marked as experimental as their results will be changed in the next major version.League\Csv\JsonConverter::download the filename is now nullableLeague\Csv\XMLConverter::download the filename is now nullableLeague\Csv\JsonConverter::save throws a TypeError exception if the $destination type is not supported.League\Csv\SwapDelimiter::apppendTo
League\Csv\SwapDelimiter::apppendToLeague\Csv\SwapDelimiter::prependToLeague\Csv\CharsetConverter::apppendToLeague\Csv\CharsetConverter::prependToLeague\Csv\XMLConverter::downloadLeague\Csv\JsonConverterLeague\Csv\Constraint\Criteria::andNotLeague\Csv\Constraint\Criteria::orNotLeague\Csv\Constraint\Criteria::xorNotLeague\Csv\Serializer\MapRecord attributeconvertEmptyStringToNull options to MapCell and to MapRecord to improve string and null conversiontrimFieldValueBeforeCasting options to MapCell and to MapRecord to improve string conversiontrimElementValueBeforeCasting option to CasToArray to improve conversion during denormalizationheaderOffset option to CasToArray to improve conversion during denormalization. The optoon is only used with the CSV shape.Cast* methods accept more input type to improve Denormalization usage when Reader::addFormatter is used or when the collection contains data other than string and null.Stream::getSize is added to the internal Stream classStream::getContents is added to the internal Stream classMapIterator::toIterator is added to the internal class MapIterator class to convert any iterable into an Iterator.array it now will be a collection of array instead of a simple array.HttpHeaders to improve file download throughout the codebase.leage\csv-doctrine is no longer a sub-split of the main league/csv package.Query feature to allow easier filtering, ordering and querying tabular data
Bom enumStream::ftellStatement::orderByAscStatement::orderByDescStatement::andWhereStatement::whereNotStatement::orWhereStatement::xorWhereStatement::andWhereColumnStatement::whereNotColumnStatement::orWhereColumnStatement::xorWhereColumnStatement::andWhereOffsetStatement::whereNotOffsetStatement::orWhereOffsetStatement::xorWhereOffsetQuery feature to allow easier filtering, ordering and querying tabular dataByteSequence Interface use the Bom enum insteadInfo::fetchBOMSequence use Bom::tryFromSequence insteadLeague\Csv\Doctrine use the new League\Csv\Constraint feature insteadLeague\Csv\Statement::create arguments; The method should be used without any argument at all. All arguments will be removed in the next major version.Reader and ResultSet docblocksBom enum instead of Info::fetchBOMSequenceAbstractCsv BOM related properties are moved to being Bom instances instead of nullable string.setOutpuBOM will only accept valid BOM sequences all other values except the empty string will throw a ValueError exception;ext-mbstring extension to work. But you should have it install in your system in order to use the mbstring related stream filters.ResultSet::chunkBy not working as documented.Using the $header argument on Statement::process is no longer deprecated. E_USER_DEPRECATED is no longer triggered.
Statement::selectTabularDataReader::getRecordsAsObjectTabularDataReader::chunkByTabularDataReader::mapHeaderTabularDataReader::getObjects use TabularDataReader::getRecordsAsObject insteadReader::select and ResultSet::select now internally use Statement::selectStatement should not throw when LimitIterator is used in combinaison with ArrayIterator.Statement internal codebase improvement.$header argument on Statement::process is no longer deprecated. E_USER_DEPRECATED is no longer triggered.mbstring extensionTabularDataReader::fetchColumn is no longer deprecatedLeague\Csv\TabularDataReader::nthAsObject equivalent to nth but returns an object or null
League\Csv\TabularDataReader::nthAsObject equivalent to nth but returns an object or nullLeague\Csv\TabularDataReader::firstAsObject equivalent to first but returns an object or nullLeague\Csv\Serializer\Denormalizer::types list all the registered typesLeague\Csv\SwapDelimiter stream filter to allow working with multibyte CSV delimiter
League\Csv\SwapDelimiter stream filter to allow working with multibyte CSV delimiterLeague\Csv\Serializer\AfterMapping to work around the limitation of not using the class constructor during denormalization.League\Csv\Serializer\Denormalizer to allow registering type alias to improve callback usage.League\Csv\Serializer\MapCell has a new property ignore to allow ignoring a property or a method during denormalization.Using the $header argument on Statement::process is deprecated and will be removed in the next version. Use TabularDataReader::getRecords on the retur…
TabulatDataReader::valueTabulatDataReader::selectTabulatDataReader::getObjectsTabulatDataReader::matchingTabulatDataReader::matchingFirstTabulatDataReader::matchingFirstOrFailResultSet::fromRecordsStream::setMaxLineLenStream::getMaxLineLenLeague\Csv\Serializer\Denormalizer to allow denormalizing records into objects #508League\Csv\FragmentFinder to implement RFC7111$header argument on Statement::process is deprecated and will be removed in
the next version. Use TabularDataReader::getRecords on the returned value instead.
It's usage will trigger a E_USER_DEPRECATED call.$header argument for TabularDataReader::getRecords becomes a full mapper between the records column offset and the column names #498ResultSet constructor now allows the records to be an array.Stream object will throw a RuntimeException if the rewind action failsfseek fails (returns -1 ) a RuntimeException will be thrown.Stream can iterate and return the full line respecting SplFielObject flags. Previously it only returned the CSV records.MapIterator::fromIterable to instantiate a MapIterator object from any iterable structure.EscapeFormula::unescapeRecord does the opposite of EscapeFormula::escapeRecord
EscapeFormula::unescapeRecord does the opposite of EscapeFormula::escapeRecordTabularReader::each (implemented on the Reader and the ResultSet object)TabularReader::exists (implemented on the Reader and the ResultSet object)TabularReader::reduce (implemented on the Reader and the ResultSet object)TabularReader::filter (implemented on the Reader and the ResultSet object)TabularReader::slice (implemented on the Reader and the ResultSet object)TabularReader::sorted (implemented on the Reader and the ResultSet object)Reader::addFormatter (implemented on the Reader and the ResultSet object)EscapeFormula::__invoke use EscapeFormula::escapeRecord insteadWriter::forceEnclosure and Writer::relaxEnclosure to control the presence of enclosure in the generated CSV
Writer::forceEnclosure and Writer::relaxEnclosure to control the presence of enclosure in the generated CSVWriter::getEndOfLine and Writer::setEndOfLineEncloseField stream filter in favor of the new Writer::forceEnclosure method.Writer::getNewline and Writer::setNewline in favor of Writer::getEndOfLine and Writer::setEndOfLineStream::fwrite to allow writing to a file in a normalized way. Internal use.Remove internal usage of deprecated methods
TabularDataWriter interface to represent how to write to a tabular data document.TabularDataReader::first to replace TabularDataReader::fetchOneTabularDataReader::nth to replace TabularDataReader::fetchOneCharsetConverter::addBOMSkippingTo to improve BOM skipping see bug #483TabularDataReader::fetchOneStream::createFromResource
Stream::__construct is made private. The class is already marked as internal so BC break does not apply on it.
Using PHP8 feature to rewrite internal codebase
Replaced simple comparisons with strict comparison operator where types are obvious in internal codebase by @astepin
Marked class constants explicitly as public by @astepin
Minimal support version PHP8.1.2
Fix Docblock and method signature using PHP8 feature (Union Type)
Fix Internal codebase around seek usage and `#75917 requires PHP8.1.2
Remove internal usage of deprecated methods
Stream::fwrite The class is already marked as internal so BC break does not apply on it.Stream::fgets The class is already marked as internal so BC break does not apply on it.$eol argumentAdded PHP7.4 typed properties where applicable
TabularDataReader::fetchColumnByName to replace TabularDataReader::fetchColumnTabularDataReader::fetchColumnByOffset to replace TabularDataReader::fetchColumnTabularDataReader::fetchColumn use TabularDataReader::fetchColumnByOffset or TabularDataReader::fetchColumnByName insteadAbstractCsv constructor is marked final via docblock.EmptyEscapeParser Polyfill used in Reader classWriter classBug fix EscapeFormula to follow OWASP latest recommendation PR #452 thanks to @robertfausk and @Lehmub
EscapeFormula to follow OWASP latest recommendation PR #452PHP8.1 compliance: using ReturnTypeWillChange to avoid emitting a unnecessary deprecation notice. thanks to cedric-anne
ReturnTypeWillChange to avoid emitting a unnecessary deprecation notice. thanks to cedric-anneUpdate dependencies requirement for development
FILTER_SANITIZE_STRING by FILTER_UNSAFE_RAW$eol argumentfix writer filter #421 by LosingBattle
League\Csv\SyntaxError::duplicateColumnNames to expose column name duplicates during header usage
League\Csv\SyntaxError::duplicateColumnNames to expose column name duplicates during header usageLeague\Csv\UnableToProcessCsv as the new Exception Marker InterfaceLeague\Csv\UnavailableStream as the new ExceptionLeague\Csv\Info::getDelimiterStats to replace the namespace function delimiter_detectLeague\Csv\Info::fetchBOMSequence to replace the namespace function bom_matchLeague\Csv\AbstractCsv::toString to replace League\Csv\AbstractCsv::getContent and League\Csv\AbstractCsv::__toStringLeague\Csv\XMLConverter::create to replace League\Csv\XMLConverter::__constructLeague\Csv\HTMLConverter::create to replace League\Csv\HTMLConverter::__constructLeague\Csv\AbstractCsv::supportsStreamFilterOnRead and League\Csv\AbstractCsv::supportsStreamFilterOnWrite to replace League\Csv\AbstractCsv::supportsStreamFilter and League\Csv\AbstractCsv::getStreamFilterModeLeague\Csv\delimiter_detect use League\Csv\Info::getDelimiterStatsLeague\Csv\bom_match use League\Csv\Info::fetchBOMSequenceLeague\Csv\AbstractCsv::getContent use League\Csv\AbstractCsv::toStringLeague\Csv\AbstractCsv::getStreamFilterMode use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWriteLeague\Csv\AbstractCsv::supportsStreamFilter use League\Csv\AbstractCsv::supportsStreamFilterOnRead or League\Csv\AbstractCsv::supportsStreamFilterOnWriteLeague\Csv\XMLConverter::__construct use League\Csv\XMLConverter::createLeague\Csv\HTMLConverter::__construct use League\Csv\HTMLConverter::createsrc directory@internal are now finalLeague\Csv\AbstractCsv::STREAM_FILTER_MODE constant replaces League\Csv\AbstractCsv::$stream_filter_modeLeague\Csv\AbstractCsv::$stream_filter_modeUsing Github actions as development tools.
BOM sequence processing fix #394
More return types and type parameters as supported in PHP7.2+
League\Csv\Statement::create named constructor to ease constraint builder instantiationLeague\Csv\Statement can now also process League\Csv\ResultSet instances.League\Csv\TabularDataReader interface to represent how to read tabular dataLeague\Csv\ResultSet::getRecords has an optional $header second argument to make the method works like League\Csv\Reader::getRecordsLeague\Csv\ResultSet::createFromTabularDataReader create a new instance from League\Csv\TabularDataReader implementing class.League\Csv\Reader no longer uses __call to implement fetchOne, fetchPairs and fetchColumn methods.is_iterableis_nullable_intImprove package exception throwing by adding new exceptions classes that extends the League\Csv\Exception exception marker class #360, #361 feature pr
League\Csv\Exception exception marker class #360, #361
feature proposed and developed by Darren Miller
League\Csv\UnavailableFeatureLeague\Csv\InvalidArgumentLeague\Csv\SyntaxErrorbom_match function see issue #363 resolved based on PR from Jerry Martinezdelemiter_detect function see issue #366bug fix the escape mechanism polyfill #358 fix provided by on2
Adding support for controlling empty record presence in Reader::getRecords return value.
Adding support for controlling empty record presence in Reader::getRecords return value.
Reader::includeEmptyRecordsReader::skipEmptyRecordsReader::isEmptyRecordsIncludedAdding support for controlling Input BOM usage in the library:
AbstractCsv::skipInputBOMAbstractCsv::includeInputBOMAbstractCsv::isInputBOMIncludedEmptyEscapeParser::parse no longer auto skip empty recordsXMLConverter::import see #348 thanks @kusabi
XMLConverter::import see #348 thanks @kusabithead, tfoot and tbody in HTMLConverter::convert via the addition of
protected methods HTMLConverter::addHTMLAttributes and HTMLConverter::appendHeaderSection #348 thanks @kusabiReader dockblock thanks @ghobaty.preg_match.Stream.AbstractCSV::chunk see #325 remove CSV flags from the Stream class to avoid infinite loop.
AbstractCSV::chunk see #325 remove CSV flags from the Stream class to avoid infinite loop.HTMLConverter.Supports for PHP7.4 empty string for the escape character
AbstractCSV::getPathname see #321 thanks @tomkyleLeague\Csv\RFC4180Field use AbstractCSV::setEscape method with an empty string instead.AbstractCSV::__construct correctly initializes properties
AbstractCSV::createFromString named constructor default argument is now an empty string
AbstractCSV::setEscape now accepts an empty string like fputcsv and fgetcsv
Writer::insertOne fixes throwing exception when record can not be inserted
XMLConverter convert to string the record value to avoid PHP warning on null value
Internal Stream::createFromString named constructor default argument is now an empty string
Internal Stream::fwrite improved
Internal Stream::__destruct no longer emit warning on invalid stream filter removal.
Internal Stream::seek returns 0 if the seeked position 0 is valid see #321 thanks @HaozhouChen
Reader:getHeader when the record is an empty line.
Writer::setFlushThreshold should accept 1 as an argument #289
Writer::insertOne allow empty array to be added to the CSV (allow inserting empty row)
Writer::insertOne allow empty array to be added to the CSV (allow inserting empty row)is_iterable polyfill for PHP7.0
is_iterable polyfill for PHP7.0Reader::getHeader no longer throws exception because of a bug in PHP7.2+ issue #279issue with error_get_last usage when using a modified PHP error handler see #254 - fixed by @csiszarattila
issue with error_get_last usage when using a modified PHP error handler see #254 - fixed by @csiszarattila
Removed seekable word from Stream exception messages.
Support for non-seekable stream. When seekable feature are required an exceptions will be thrown.
League\Csv\EncloseField to force enclosure insertion on every field. #269League\Csv\EscapeFormula a League CSV formatter to prevent CSV Formula Injection in Spreadsheet programs.League\Csv\RFC4180Field::addTo accept an option $replace_whitespace argument to improve RFC4180 compliance.League\Csv\Abstract::getContent to replace League\Csv\Abstract::__toString. The __toString method may trigger a Fatal Error with non-seekable stream, instead you are recommended to used the new getContent method which will trigger an exception instead.League\Csv\Abstract::__toString use League\Csv\Abstract::getContent instead. the __toString triggers a Fatal Error when used on a non-seekable CSV document. use the getContent method instead which will trigger an exception instead.Reader::createFromPath default open mode is r see #258 and #266CSV controls not applied when calling Writer::insertOne
League\Csv\Reader::getRecords to access all CSV records
League\Csv\Reader::getRecords to access all CSV recordsLeague\Csv\Statement provides a constraint builder to select CSV records.League\Csv\ResultSet represents the result set of the selected CSV records.League\Csv\delimiter_detect function to detect CSV delimiter characterLeague\Csv\Reader::getHeaderLeague\Csv\Reader::getHeaderOffsetLeague\Csv\Reader::setHeaderOffsetLeague\Csv\CharsetConverter converts CSV records charset.League\Csv\XMLConverter converts CSV records into DOMDocumentLeague\Csv\HTMLConverter converts CSV records into HTML table.League\Csv\Exception the default exceptionLeague\Csv\CannotInsertRecordLeague\Csv\AbstractCsv::chunk method to output the CSV document in chunkLeague\Csv\bom_match function to detect BOM sequence in a given stringLeague\Csv\ByteSequence interface to decoupled BOM sequence from CSV documentsLeague\Csv\ColumnConsistencyLeague\Csv\Writer::setFlushThresholdLeague\Csv\Writer::getFlushThresholdLeague\Csv\RFC4180Field to format field according to RFC4180 rulesImproved CSV record insertion
League\Csv\Writer::insertOne only accepts an array and returns a integerLeague\Csv\Writer::insertAll only accepts an iterable of array and returns an integerNormalized CSV offset returned value
League\Csv\Reader::fetchColumn always returns the CSV document original offset.examples directoryPHP5 supportLeague\Csv\AbstractCsv::stripBOMLeague\Csv\Writer::jsonSerializeLeague\Csv\AbstractCsv::toHTMLLeague\Csv\AbstractCsv::toXMLLeague\Csv\AbstractCsv::setInputEncodingLeague\Csv\AbstractCsv::getInputEncodingLeague\Csv\AbstractCsv::isActiveStreamFilterLeague\Csv\AbstractCsv::setStreamFilterModeLeague\Csv\AbstractCsv::appendStreamFilterLeague\Csv\AbstractCsv::prependStreamFilterLeague\Csv\AbstractCsv::removeStreamFilterLeague\Csv\AbstractCsv::clearStreamFiltersLeague\Csv\AbstractCsv::newReaderLeague\Csv\AbstractCsv::newWriterLeague\Csv\Reader::getNewlineLeague\Csv\Reader::setNewlineLeague\Csv\Exception\InvalidRowException;League\Csv\Statement class:
League\Csv\AbstractCsv::addFilter,League\Csv\AbstractCsv::addSortBy,League\Csv\AbstractCsv::setOffset,League\Csv\AbstractCsv::setLimit;League\Csv\Reader::eachLeague\Csv\Reader::fetchLeague\Csv\Reader::fetchAllLeague\Csv\Reader::fetchAssocLeague\Csv\Reader::fetchPairsWithoutDuplicatesLeague\Csv\Writer::hasFormatterLeague\Csv\Writer::removeFormatterLeague\Csv\Writer::clearFormattersLeague\Csv\Writer::hasValidatorLeague\Csv\Writer::removeValidatorLeague\Csv\Writer::clearValidatorsLeague\Csv\Writer::getIteratorLeague\Csv\Plugin\SkipNullValuesFormatterLeague\Csv\Plugin\ForbiddenNullValuesValidatorLeague\Csv\Plugin\ColumnConsistencyValidator replace by League\Csv\ColumnConsistencyLeague\Csv\Writer no longers implements the IteratorAggregate interfaceLeague\Csv\AbstractCsv::fetchDelimitersOccurrence is removed replace by League\Csv\delimiter_detect functionReader::fetchAssoc no longer throws exception because of a bug in PHP7.2+ issue #279
Reader::fetchAssoc no longer throws exception because of a bug in PHP7.2+ issue #279Writer::insertOne was silently failing when inserting record in a CSV document in non-writing mode.
Writer::insertOne was silently failing when inserting record in a CSV document in non-writing mode.Removed @deprecated from selected methods issue #208
Reader::getRow when using a StreamIterator issue #213@deprecated from selected methods issue #208AbstractCsv::createFromStream to enable working with resource stream issue #202
AbstractCsv::createFromStream to enable working with resource stream issue #202League\Csv\AbstractCsv::stripBomLeague\Csv\Reader::getOffsetLeague\Csv\Reader::getLimitLeague\Csv\Reader::getSortByLeague\Csv\Reader::getFilterLeague\Csv\Reader::setOffsetLeague\Csv\Reader::setLimitLeague\Csv\Reader::addSortByLeague\Csv\Reader::addFilterLeague\Csv\Reader::fetchLeague\Csv\Reader::eachLeague\Csv\Reader::fetchPairsWithoutDuplicatesLeague\Csv\Reader::fetchAssocLeague\Csv\Writer::removeFormatterLeague\Csv\Writer::hasFormatterLeague\Csv\Writer::clearFormattersLeague\Csv\Writer::removeValidatorLeague\Csv\Writer::hasValidatorLeague\Csv\Writer::clearValidatorsLeague\Csv\Writer::jsonSerializeLeague\Csv\Writer::toHTMLLeague\Csv\Writer::toXMLAbstractCsv::BOM_UTF32_LE value fixed
AbstractCsv::BOM_UTF32_LE value fixedgetInputBOM method name is now consistent everywhere in the API PR #171
getInputBOM method name is now consistent everywhere in the API PR #171output method header content-type value to text/csv PR #175The package now includes its own autoloader.
Ouput::getInputEncodingOuput::setInputEncodingOuput::getEncodingFrom replaced by Ouput::getInputEncodingOuput::setEncodingFrom replaced by Ouput::setInputEncodingReader::fetchPairsWithoutDuplicates
Reader::fetchPairsReader::fetchPairsWithoutDuplicatesReader::fetchColumn and Reader::fetchAssoc now return IteratorReader::fetchAssoc callable argument expects an indexed row using the submitted keys as its first argumentReader::fetchColumn callable argument expects the selected column value as its first argumentsetOutputBOM is removedAbstractCsv::getOutputBOM always return a stringAbstractCsv::getInputBOM always return a stringControls::setFlagsControls::getFlagsControls::detectDelimiterListQueryFilter::removeFilterQueryFilter::removeSortByQueryFilter::hasFilterQueryFilter::hasSortByQueryFilter::clearFilterQueryFilter::clearSortByReader::query$newline argument from AbstractCsv::createFromStringReader::fetch replaces League\Csv\Reader::query for naming consistency
Reader::fetch replaces League\Csv\Reader::query for naming consistencyControls::fetchDelimitersOccurrence to replace Controls::detectDelimiterList the latter gives erronous resultsControls::detectDelimiterListReader::query$newline argument from AbstractCsv::createFromStringSplFileObject flags usage PR #130AbstractCsv::createFromString no longer trim the submitted string issue #132Enclosures should be removed when a BOM sequence is stripped issue #102
SplFileObject flags were not always applied using query filter issue #99
SplFileObject flags were not always applied using query filter issue #99stripBOM query filtering method to ease removing the BOM sequence when querying the CSV document.
stripBOM query filtering method to ease removing the BOM sequence when querying the CSV document.Writer class for conversion methods.setFlags on conversion methods SplFileObject default flags are SplFileObject::READ_AHEAD|SplFileObject::SKIP_EMPTYinsertOne now takes into account the escape character when modified after the first insert.setFlags: SplFileObject::DROP_NEW_LINE can be remove using setFlags method.
setFlags: SplFileObject::DROP_NEW_LINE can be remove using setFlags method.A new flexible mechanism to format and validate a row before its insertion by adding
Writer::addFormatter to add a formatter to the Writer objectWriter::removeFormatter to remove an already registered formatterWriter::hasFormatter to detect the presence of a formatterWriter::clearFormatters to clear all registered formatterWriter::addValidator to add a validator to the Writer objectWriter::removeValidator to remove an already registered validatorWriter::hasValidator to detect the presence of a validatorWriter::clearValidators to clear all registered validatorLeague\Csv\Exception\InvalidRowException exception thrown when row validation failedWriter class
League\Csv\Plugin\ColumnConsistencyValidator to validate column consistency on insertionLeague\Csv\Plugin\ForbiddenNullValuesValidator to validate null value on insertionLeague\Csv\Plugin\SkipNullValuesFormatter to format null value on insertionjsonSerialize, toXML and toHTML output can be modified using Reader query options methods.AbstractCSV::detectDelimiterList index keys now represents the occurrence of the found delimiter.getNewline and setNewline are accessible on the Reader class too.createFromString now accepts the $newline sequence as a second argument to specify the last added new line character to better work with interoperability.setDelimiter, setEnclosure and setEscape are removedSplFileObject flags value is now SplFileObject::READ_CSV|SplFileObject::DROP_NEW_LINEnewReader and newWriter methodsAbstractCSV::output method now returns the number of bytes send to the output bufferReader::fetchColumn will automatically filter out non existing values from the return arrayini_set("auto_detect_line_endings", true); is no longer set in the class constructor. Mac OS X users must explicitly set this ini options in their script.Writer and Reader default constructor are removed from public API in favor of the named constructors.Writer methods and constant related to CSV data validation and formatting before insertion
Writer::getNullHandlingModeWriter::setNullHandlingModeWriter::setColumnsCountWriter::getColumnsCountWriter::autodetectColumnsCountWriter::NULL_AS_EXCEPTIONWriter::NULL_AS_EMPTYWriter::NULL_AS_SKIP_CELLto manage BOM character with CSV.
AbstractCSV::setOutputBOMAbstractCSV::getOutputBOMAbstractCSV::getInputBOMto manage BOM character with CSV.
Your coding agent can read these notes before it upgrades. Set up the MCP server →