$fh = @fopen("csv_file_name", "r"); if ($fh) { if (flock($fh, lock_ex)) { while (!feof($fh)) { $line = fgets($fh); if (strstr($line, $target_email_address) !== false) { $data = split(",", $line); // $data *is* an array } } flock($fh, lock_un); } fclose($fh); }
php搜索csv表格中是否存在指定数据
![20期PHP线上班](http://m.sbmmt.com/img/upload/aroundimg/000/000/001/62b28d06f0da4985.png)