I have the following function that exports the data from an array to a csv file.
function exportcsv($dataArray , $fileName){
$file = fopen("$fileName.csv","w");
fputcsv($file , $dataArray['checkedArr']); // write the columns
foreach ($dataArray['selectedData'] as $data){ // write the data
fputcsv($file , $data);
}
fclose($file);
}
However this file is being created in the same folder as the page I'm using it in. How can I export this file to another folder?