PHP-based CSV editor? [closed]

无人久伴 提交于 2019-12-11 06:10:00

问题


Does anyone know of an online CSV editor written in PHP that will allow a user to open, edit, and save a given CSV file?

All I can find are CSV classes and nothing that can handle dynamic files, just predefined lengths etc.


回答1:


Parse the CSV file into array. Then, use an array of arrays to populate a matrix of text boxes in your web page. When you submit the form, read the data from $_POST and use fputcsv() to save it.

Think about validation, if relevant.




回答2:


So you want to be able to open a file, edit it using a web based UI and save it? Why not use Google Docs?

EDIT: Its irritating when people vote you down without leaving a comment as to why... Useless contributions...




回答3:


fgetcsv would solve your issue. Basically it takes in CSV file and parses it out into an array.




回答4:


http://www.phpclasses.org/package/2124-PHP-Retrieve-or-change-information-stored-in-CSV-files.html

Point it at a csv, tell it the delimiter, unique field and tell it to edit. Very simple to use. I've had an issue with the delete button but I only just tried it for the first time, I'm sure I can work that out.

Saved me some hours trying to build and test my own.

Edit: Worked out the issue with the unique column (or KeyFieldName as he calls it) don't have spaces in the name of that column (the first row of the csv)



来源:https://stackoverflow.com/questions/1191459/php-based-csv-editor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!