Jump to content

Email Duplicate Removal More Than 20k not working


soma56

Recommended Posts

I've created a script to remove duplicate emails and it works perfectly up to about 20k. After that it just stops with no error code. I'm baffled. I've increased the max_execution_time to 2 hours even though this script just takes a few minutes.

 

<?PHP
function validElement($element) {
    return strlen($element) > 1;
}

function in_iarray($str, $a){
foreach($a as $v){
if(strcasecmp($str, $v)==0){return true;}
}
return false;
}

remove_duplicates();
}
//Remove more duplicates from list
function array_iunique($a){
$n = array();
foreach($a as $k=>$v){
if(!in_iarray($v, $n)){
echo $v;
$n[$k]=$v;}
}
return $n;
}

//Remove duplicates from list
function remove_duplicates() {

$p = 0;
while ($p != 1) {
   
$rawemaillist = array_values(array_filter($rawemaillist, "validElement"));
$p = 1;
}
$initial = count($rawemaillist);
$k = 0;
while ($k != 1) {
$rawemaillist = array_iunique($rawemaillist);
$k = 1;
}
?>

 

The script works fine - but only up to around 20 k - which leads me to believe its a server setting issue. Is there something in the php.ini file I should or otherwise a setting that I should be looking at to change???

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.