PHP Find String in CSV file

后端 未结 6 1156
无人及你
无人及你 2020-12-17 17:36

I\'ve got a large flat file of usernames and emails in the following format:

\"username\", \"email\"
\"username\", \"email\"
\"username\", \"email\"
<         


        
6条回答
  •  轮回少年
    2020-12-17 18:04

    As per reko_t's suggestion: Use fgetcsv to read individual lines of csv into arrays, until you find one where the second element matches your search term. The first element then is the username. Something like:

提交回复
热议问题