就像您在标题中所说的那样,fgetcsv是必经之路。它很容易使用。file=fopen('myCSVFile.csv','r');while(($line=fgetcsv($file))!FALSE){/$line is an array of the csv elements print_r($line);} fclose($file);您...
while(($data=fgetcsv($handle,1000,","))!FALSE){ row+;data_entries[]=$data;} fclose($handle);} this you'll have to expand foreach($data_entries as$line){ sql="INSERT INTO. db->execute($line);}来源:...