aşağıdaki biçimde kullanıcı adı ve e-postaların büyük bir düz dosyası var file kullanıcı adı, ancak bir sebepten dolayı sonuç döndürmez. Tersini ararsam işe yarıyor.PHP Bul Dize
$string = "[email protected]";
$filename = "user_email.txt";
$h = fopen("$filename","r");
$flag=0;
while (!feof ($h)) {
$buffer = fgets($h);
$thisarray = split(",", $buffer);
if ($string == str_replace('"','', $thisarray[1])) {
$i = 1;
$i++;
echo '<td bgcolor="#CCFFCC"><b style="color: maroon">' . str_replace('"','',$thisarray[0]). '</b></td>';
}
Herhangi bir fikir? Teşekkürler!
Bir dosya tanıtıcısından CSV satırını okumak için 'fgetcsv' komutunu kullanabilirsiniz: http://php.net/fgetcsv –
[PHP Read CSV'nin olası kopyası ve tarihe göre filtrele] (http://stackoverflow.com/questions/2127775/php-read-csv-ve-filter-by-date # 2128053) – Gordon