Php searches for the specified data in a csv table. In php, you can search for the csv table to see if the specified data exists. in csv, the principle is to open the csv file, and then search for the specified content in one row to see if it is included in the code, if the php search csv table contains the specified data, // The principle of searching for the csv data is to open the csv file, and then search for the specified content in one row to see if it is included in the code, true is returned.
Search for specified data in a csv table in the php Tutorial
// The principle of searching for csv data is to open the csv file and search for whether the specified content is included in the code in one row. If yes, true is returned.
// Search for specified content in csv
$ 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 );
}
...