Array internal data query problem, ask for help!
There are now three arrays of $data1=array (' 1,2,3,4,5,6 ', ' 1,2,3,4,5,7 ', ' 1,2,3,4,5,8 ', ' 1,2,3,4,5,9 ');
$data 2=array (1,3,5,7,11,13,15,17,19,21);
$data 3=array (3,6,9,12,15,18,21,24);
At the same time, the array $data1 already exists in the database HMK
The format is as follows:
L1 L2 L3 L4 L5 L6
1 2 3 4 5 6
1 2 3 4 5 7 ....
Now I want to add the field data2 Data3 in HMK to store the number of occurrences of each record in $data2, $data 3. Is there any good way?
Should you operate within an array and then store the results in a database or directly within the database? Please help me,!~~!
------Solution--------------------
PHP Code
$value) { $data 1[$key].= ', '. Count (Array_intersect (' Explode (', ', ' $value '), $data 2)); $data 1[$key].= ', '. Count (Array_intersect (Explode (', ', $value), $data 3));} Print_r ($data 1);