From 2658750c0eb140214f70408921d7f7c159420ecc Mon Sep 17 00:00:00 2001 From: Jaideep Singh Kandari Date: Wed, 22 Dec 2021 13:07:08 +0530 Subject: [PATCH] Added method to retrieve headers of CSV --- src/Parser.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Parser.php b/src/Parser.php index 098773c..7f94413 100644 --- a/src/Parser.php +++ b/src/Parser.php @@ -229,4 +229,13 @@ public function _sanitize($string) { return preg_replace("/\xEF\xBB\xBF/", "", trim($string)); } + + /** + * Returns all the headers(columns) of the CSV. + * + * @return array + */ + public function getHeaders() { + return $this->headers; + } }