I tried use function parameter $separator instead ";" in str_getcsv function but I got an error. Do you have any ideas what Can I do with it? I must read a few CSV files with diffrent separators. Error code: Undefined variable: separator in .. number on line 59
function CSV2DB($producent,$znak='',$separator,$ilosc_col) {
$time_start = microtime(true);
ini_set('max_execution_time', 50000); //wydłużenie czasu wykonania
global $pdo;
$log ="";
$count = 0;
$edit_date = date("Y-m-d H:i:s");
$dane = array();
$dir = 'C:\\xampp\\htdocs\\Prusik\\csv\\';
//sciezka do pliku
$real_path = $dir . $producent . '.csv';
//csv do tabeli
$data = array_map(
function($v)
{
return str_getcsv($v, ";");
}, file($real_path));