php - Four txts a, b, c, and d. Compare how many of the three txts bcd are in a. These four files are about 250M.
怪我咯
怪我咯 2017-05-16 13:07:52
0
3
457
  1. The rules are as follows:

    < /p>

I have tested it myself and set up these two ini_set('memory_limit', '-1');set_time_limit(0);, and then after running it for a long time, it reported a 500 error. Please help!!!

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
仅有的幸福

Lots of data. It is estimated that the database will die easily. For simple comparison, first write a script to save the data into redis. The cache key of table a is a.0 a.1 a.2 or something, b.000000036 or something. The last two rules remain the same. After importing, determine the total number of data in a

Write a for loop

$redis= new Redis();
$Acount = 100000; //a的总数
$num  = 1;
$chkary = [1,2,3,4,5,6,7,8,9];//判断用的数组
for ($i=0;$i<=$Acount;$i++){
    $data = $redis->get('a.' . $i);
   if( $redis->exists('b.'.$data)){
       //存在 code
   }
   $num++;
   if(in_array(($Acount/$num),$chkary)){
       sleep(1); //防止卡死
   }
}
漂亮男人

You can write a script to cache the contents of the four texts into four Redis collections, and then find the intersection. This is very fast. I wonder if this is allowed?

给我你的怀抱

The 500 error is that there is not enough memory. You can execute a few lines to release the useless memory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template