Use the getMulti function of memcached to obtain the values of the following 15 IDs in batches.
31639,33878,177410,9735,589,12076,25953,22447,15368,15358,33853,26658,26659,12477,15366
$md->getMulti($arr_id );
Return order:
line_31639,line_33878,line_177410,line_9735,line_589,line_12076,line_25953,line_22447,line_15368,line_15358,line_33853,line_26658,line_26659,line_1 2477, line_15366,
Return when one memcache is correct. When there are multiple memcaches, it is impossible to return them in order one by one.
At this time, you need to use Memcached::GET_PRESERVE_ORDER to return data in order:
$arrs = $mem->getMulti($arr_id, $cas, Memcached::GET_PRESERVE_ORDER);
Returned Order:
line_31639,line_33878,line_9735,line_589,line_22447,line_15358,line_33853,line_26658,line_177410,line_12076,line_25953,line_15368,line_26659,line_12477,line_ 15366,
Among them, if there is no hit variable , then $cas will work. $cas returns the hit variable, traverse $cas to retrieve the hit variable composition data, and then compare it with $arr_id through the array_diff function to get the difference, and then set it one by one.