我如何在PHP中创建一个接口来添加数据csv文件
问题描述:
hey...i need to create a html+php+javascript interface
where i got three text area and i want::::
that if i'll enter some data into text area and pressing submit button,,then it'll enter that textarea's data into a csv file..
pls some one help....
嘿...我需要创建一个html + php + javascript界面 p> 其中我有三个文本区域,我想要:::: p>
如果我将一些数据输入文本区域并按下提交按钮,那么它将进入该textarea的 将数据转换为csv文件.. p>
请一些帮助.... p> div>
答
$fp = fopen('file.csv', 'w'); fputcsv($fp, $_GET['TextArea']); fclose($fp);
?>
答
<?php
$list = arrary();
//your array will have all the fields from the form, textfields and textareas
$fp = fopen('output.csv', 'w');
foreach ($list as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
?>