public function getCSV($array)
    {
        ob_start(); // buffer the output ...
        $out = fopen('php://output', 'w');
        fputcsv($out, array_keys($array[0]), ";");
        array_shift($array);
        foreach ($array as $line) {
            fputcsv($out, $line, ";");
        }
        fclose($out);
        return ob_get_clean(); // ... then return it as a string!
    }