jabranr / csv-parser

PHP client to parse CSV data from a path, file, stream, resource or string into indexed or associative arrays.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spaces after commas causing wrong keys definition in header mode

arfeen opened this issue · comments

Consider an example having spaces after comma (usual data entry):
name, place, thing, animal\narfeen, karachi, monitor, lion
These spaces will cause wrong keys in associative arrays in header mode:

Array
(
    [0] => Array
        (
            [name] => arfeen
            [ place] =>  karachi
            [ thing] =>  monitor
            [ animal] =>  lion
        )
)

Spaces should be trimmed here.

@arfeen Thank you. Now in develop!