$handle = fopen("items.csv", "r"); //The 'r' opens the file for reading only. while (($data = fgetcsv($handle, 1000, ",")) !==FALSE) { //fgetcsv returns FALSE on error, including end of file. $num = count($data); for ($c=0; $c < $num; $c++) { if ($data[$c] == $items) { print "FOUND PICTURE IN ARRAY! POSITION $c - See $data[$c] == $items
\n"; } }