0

Im doing a project in PHP(Codeigniter) and the project should be able to import excel files data and store in database. What is the best way to import and export excel files in PHP.

lcshobin
  • 125
  • 1
  • 16

3 Answers3

1

fgetcsv is for .cvs (comma separated values) files.

Excel stores a lot more information than a *.cvs file, e.g. formulas, styles, etc. You would have to convert your file to *.cvs and doing so you would loss a lot of additional functionally. *.cvs files are fast to parse field data but if you need anything beyond that you probably want to go with PHP Excel.

hxtree
  • 187
  • 12
0

PHPExcel would be my choice, their library and documentation is more informed and larger, with what seemingly looks like an easier usage.

The only drawback I can see is the lack of ease of use with the PhP function.

Blake Connally
  • 689
  • 1
  • 4
  • 16
0

Actually, there are no technical dis-advantages of using PHP's inbuilt functions. In fact, libraries are developed upon such in-built functions. However, there are many advantages of using a well developed and maintained library like PHPExcel:

  • You don't need to re-invent the wheel. What you need is almost developed. You just need to invest time in customization.
  • Library is open-source. Many developers would have contributed their time and efforts. It is more likely to have robustness and stability.
  • Standards would be followed. It makes it easier to maintain.
  • Any individual might not be aware of all the possible issues. Some generic issues might have already been resolved. This again saves your time. Such libraries are easily scalable.

You can think of reverse of above mentioned points as dis-advantages of using in-built functions.

Bhavik Shah
  • 2,300
  • 1
  • 17
  • 32