This is the blog for getting Idea regarding PHP, Magento, jQuery and JavaScript for Customization.

Saturday 6 June 2015

PHP : Get Array of CSV file in PHP

Hello Friends,

Method 2::

Here, second method for read the CSV file, its returns Array of the CSV data !

PHP
<?php

          $file = "Path of File Name";
          $csv = new Varien_File_Csv();
          $data = $csv->getData($file);

         Print_r($data); /*This will give Array of CSV file data*/

?>

If you want to read CSV line by line you can use Method 1 also,

Also, need to get PHP array to jQuery refer this Link,

May this help you !
,

No comments:

Post a Comment