خرید بک لینک

Vote count: 0

I have a text file in which 50000 email ids are stored. I need to filter data from this file by deleting email ids of unsubscribes.

I have tried this code but no luck

<?php
ini_set("memory_limit","1520M");
ini_set('display_errors',1);
error_reporting(E_ALL);
$emails = $_POST['emails'];
$data = $_POST['data'];
$path= $_SERVER['DOCUMENT_ROOT']."/data/$data";
$lines = file($path);
$remove = explode("n",$emails);
foreach ($remove as $rm)
{
foreach($lines as $key => $line)
if(stristr($line, $rm)) unset($lines[$key]);
}
$data1 = implode('', $lines);
$file = fopen($path, "w+");
fwrite($file, $data1);
fclose($file);
?>

How can I delete the different number of email ids from a file and keep the other ids remain in file?

asked 25 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 24 مرداد 1395 ساعت: 20:31

صفحه بندی