まず、CSVにデータがある
このデータを元に連想配列を作る
$data = []; $fp = fopen("Book.csv", "r"); while(! feof($fp)){ $csv = fgets($fp); $csv = trim($csv,'"'); $csv = mb_convert_encoding($csv, "UTF-8", "utf-8"); $csv = str_replace('"','',$csv); $array = explode(",",$csv); $data[$array[0]] = $array[1]; } echo "<pre>"; var_dump($data); echo "</pre>";
まあOKっぽい。。