Find a comparison of the effect display 20172120844dj ronalremix this damn gentle DISCO2120843lucky_twice-magic necklace first-DJ-dance music-slow shake 2120842 Beaut find a comparison of the effect display
-----------------------------------------------------
2120844 DJ Cristiano Ronaldo Remix this damn gentle DISCO
2120843 lucky_twice-magic necklace first-DJ-dance music-slow shake
2120842 Beautiful_Girls _ (DJ → dream extension Extended_Remix)
2120841 DjRuico_FunkyHouse_Remix
----------------------------------------------------
Okndrc 1 DjRuico_FunkyHouse_Remix
DGERR2 lucky_twice-magic necklace first-DJ-dance music-slow shake
EGDSF3 DJ ronalremix this damn gentle DISCO
EEEED4 Beautiful_Girls _ (DJ → Mengshu Extended_Remix)
--------------------------------------------------
The effect to be achieved is:
DJ Rono Remix this damn gentle DISCO [a] 2120844 [/a] [bb] EGDSF3 [/bb]
Lucky_twice-magic necklace first-DJ-dance music-slow shake [a] 2120843 [/a] [bb] DGERR2 [/bb]
Beautiful_Girls _ (DJ → dream extension Extended_Remix) [a] 2120842 [/a] [bb] EEEED4 [/bb]
DjRuico_FunkyHouse_Remix [a] 2120841 [/a] [bb] okmcm 1 [/bb]
In fact, we compare the records of A and B to make A unique comparison by name,
I don't know what code to use. JS, ASP, or PHP
------ Solution --------------------
PHP code
$ A = array ('20140901', 'DJ ronalremix this damn gentle DISCO '), array ('20140901 ', 'lucky _ twice-magic necklace first-DJ-dance music-slow shake '), array ('000000', 'beauul ul _ Girls _ (DJ → Mengshu Extended_Remix )'), array ('20140901', 'djruico _ FunkyHouse_Remix '),); $ B = array ('okndrc 1', 'djruico _ FunkyHouse_Remix'), array ('dgerr2 ', 'lucky _ twice-magic necklace first-DJ-Dance-slow shake '), array ('egdsf3', 'DJ ronallow Remix this damn gentle DISCO '), array ('eeeed4', 'beauul ul _ Girls _ (DJ → dream extension ded_remix) '),); $ r = array (); foreach ($ a as $ v) $ r [$ v [1] [] = $ v [0]; foreach ($ B as $ v) $ r [$ v [1] [] = $ v [0]; foreach ($ r as $ k => $ v) echo "$ k [a] $ v [0] [/a] [bb] $ v [1] [/bb] \ n ";
------ Solution --------------------
HTML code
Test
Script function $ (id) {return document. getElementById (id);} function text3 () {var text1 = $('text1 '). value; var textArray1 = text1.split ('\ n'); var text2 = $('text2 '). value; var textArray2 = text2.split ('\ n'); var colArray1, colArray2; var resultStr = ''; for (var i1 in textArray1) {colArray1 = textArray1 [i1]. split (''); for (var i2 in textArray2) {colArray2 = textArray2 [i2]. split (''); if (colArray1 [1] = colArray2 [1]) {resultStr + = colArray1 [1] + '[a]' + colArray1 [0] + '[/a] [bb]' + colArray2 [0] + '[/bb] \ n ';}}} $('text3 '). value = resultStr;} script