HOW TO IMPORT CSV FILE IN PHP?

Pravesh Singh

Total Post:412

Points:2888
Posted by  Pravesh Singh
PHP 
PHP
 6040  View(s)
Ratings:
Rate this:
Hello Guys,
I want to import csv file in php but I don't have and idea because I'm naive user for php. So please help me and paste your code snippets too.

 
  1. Arun Singh

    Post:68

    Points:476
    Re: How to import csv file in php?

    Hi Pravesh,
    To import csv file data, you can use array to store data of file line by line. Check this code snippets...
    <?php
     $arrResult = array();
    $arrLines = file('MyCSVFile.csv');
    foreach($arrLines as $line) {
    $arrResult[] = explode( ',', $line);
    }
    ?>

    It might be helpful for you.

  1. Vaidotas Dazzas

    Post:1

    Points:7
    Re: How to import csv file in php?



    Using this CSV Import script You can import data into MYSQL then echo in php.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!