Only add csv values to PHP array that do not contain string -
i'm trying create array of values ($import_data) csv file contains 42,000 rows, each row contains sku. want add values array not contain string "cnv". there easy way this?
here how adding values csv array:
while ( ( $line = fgetcsv($handle, 0, $post_data['import_csv_separator']) ) !== false ) { $import_data[] = $line; }
this solved it!
while ( ( $line = fgetcsv($handle, 0, $post_data['import_csv_separator']) ) !== false ) { $test_str = print_r($line,true); if (strpos($test_str, "cnv") === false){ // add $import_data[] = $line; }
Comments
Post a Comment