Find if a value exist in a CSV file with PHP

后端 未结 3 1750
时光说笑
时光说笑 2021-01-13 15:32

This is my code to check if a row of my .csv file contains a specific name, but it does not work.

I think it has something to do with the if statement.<

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-13 16:18

    Try using in_array instead of ==

    if(in_array('paul', $line_of_text)) {
      // FOUND
    }
    

提交回复
热议问题