Awesome Conversion Script

Import/Export CSV, Excel, PDF, Database , Array, HTML, SQL, XML

Insert/Append records to CSV


Student No
Title
First Name
Last Name
Gender
Male Female
Home No
Address
Mobile No
Email
Institute
Grade
Delimeter
Code For CSV
<?php
/* include the ACS class page */
   require_once("../../classes/ACS.php");

/* Step 1: create object of the ACS class */
   $ACS=new ACS();
   
/* Step 2: set values of required parameters */   
//set append=true as we will add new row in csv everytime on insert operation
$ACS->append=true;

//set path of the existing csv file, on which we will save/append data
$ACS->existingFilePath="demo_excel_csv/STUDENTS.csv";

//set 2 dimensional associative array
$data=array(array("studentNo"=>$_POST["studentNo"], "title"=>$_POST["title"], "firstName"=>$_POST["firstName"], "lastName"=>$_POST["lastName"], "gender"=>$_POST["gender"], "address"=>$_POST["address"], "mobileNumber"=>$_POST["mobileNo"], "homeNumber"=>$_POST["homeNo"], 
"email"=>$_POST["email"], "institute"=>$_POST["institute"], "grade"=>$_POST["grade"]));

$ACS->arrayToCSV($data); //convert array to csv

?>