PHP: How to get line from txt and dont repeat -


hello im using multithread class emails list

using file_get_contents("http://server.com/getemails.php");

this getemails.php:

index = file("index.dat"); $index = $index[0]; $f_contents = file("../susc/ar.txt"); $line = $f_contents[$index]; $data = $line;  file_put_contents("index.dat",$index +1);  echo $data; 

it gets data "../susc/ar.txt" file has 100.000 lines :

sampleuser@hotmail.com suscribeduser@hotmail.com exampleemail@hotmail.com ... 

but, when run program multithreaded .. gives lot of repeated emails

like this:

[thread][t11] -> sampleuser@hotmail.com  [thread][t12] -> sampleuser@hotmail.com  [thread][t8] -> sampleuser@hotmail.com  [thread][t1] -> sampleuser@hotmail.com  [thread][t2] -> sampleuser@hotmail.com  [thread][t5] -> suscribeduser@hotmail.com  [thread][t3] -> suscribeduser@hotmail.com  [thread][t6] -> suscribeduser@hotmail.com  [thread][t7] -> suscribeduser@hotmail.com  [thread][t4] -> suscribeduser@hotmail.com  [thread][t14] -> exampleemail@hotmail.com  [thread][t9] -> exampleemail@hotmail.com  [thread][t10] -> exampleemail@hotmail.com 

my question is, method can use line text file , dont repeat on next request


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -