Using PHP to read csv file is a common thing to do. Sadly there is no solid standard on delimiters, depends on fully from where you get your csv file. Usually simple csv exports are a bit different than what you get from xls to csv conversion. So I wrote a little function that detects csv delimiters of cells / fields. It counts predefined delimiter possibilites from the first row. Assumes that the highest occurred possible delimiter is the delimiter.
Source code viewer
/** * Detect delimiter of cells. * * @param string $name * CSV file path. * * @return array * Return detected delimiter. */ function detect_delimiter($name) { ';' => 0, ',' => 0, ); foreach ($delimiters as $delimiter => &$count) { } }Programming Language: PHP