<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
include 'qa-include/qa-db-users.php';
// Set path to CSV file
$csvFile = 'users1.csv';
$csv = readCSV($csvFile);
echo '<pre>';
print_r($csv);
echo '</pre>';
foreach ($csv as $data) {
qa_db_user_create($data[2], $data[3], $data[1], 0, '1320615024');
}
function readCSV($csvFile){
$file_handle = fopen($csvFile, 'r');
while (!feof($file_handle) ) {
$line_of_text[] = fgetcsv($file_handle, 1024);
}
fclose($file_handle);
return $line_of_text;
}
?>
I used like this on root directory but it redirects me to my homepage. Where I can use this exactly.