diff options
Diffstat (limited to 'it_pipe.class')
| -rw-r--r-- | it_pipe.class | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/it_pipe.class b/it_pipe.class index a2588fe..967cc77 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -203,7 +203,7 @@ function csv($p = [])  	$p = is_string($p) ? ['forceschema' => $p] : $p;  	$counts = count_chars($this->lines[0]);  	$splitchar = $counts[ord("\t")] ? "\t" : ($counts[ord(";")] > $counts[ord(",")] ? ";" : ","); -	$csvhead = it::replace(['^\x{FEFF}' => ''], array_shift($this->lines)); // it::replace removes utf8 byte order mark +	$csvhead = it::replace(['^\x{FEFF}' => ''], array_shift($this->lines));	# it::replace removes utf8 byte order mark  	$schema = $p['forceschema'] ? explode(",", $p['forceschema']) : str_getcsv(trim($csvhead, "#\n "), $splitchar, '"'); # should function_exists('str_getcsv')  	foreach ($schema as $idx => $col)  		$schema[$idx] = it::replace(['^$' => "field$idx", '\W' => $p['fixcolnames'] ? "_" : '$0'], $col); |