The code contains oneline data and twoline data. how can we combine these two groups of data?
Public function line ($ config, $ qq = '', $ data = array () {$ array = array (); $ line = $ config ['line']; $ url = trim ($ config [$ line]); if ($ line = 'oneline '& $ qq! = '') {$ Content = $ this-> proGetCont ($ url. '/index. php? M = account & c = index & a = search & q = '. $ qq); preg_match_all ('/([\ S \ S] *?) <\/Tr>/I ', $ content, $ pregArray); if (count ($ pregArray) {foreach ($ pregArray [0] as $ value) {preg_match_all ('/
<\ td>
/I ', $ value, $ v); $ Marshal = $ this-> strSub ($ v [0] [3], 'fa "> ',''); $ Ipid = M ('iplib')-> where ('Marshal = \''. $ marshal. '\ '')-> find () ['id']; if (! $ Ipid) {$ ipid = M ('iplib')-> add (array ('marshal' => $ Marshal, 'namelist' => '1 '));} $ timsInt = strtotime ($ this-> strSub ($ v [0] [4], 'fa "> ',''); $ BoolTure = true; foreach ($ data as $ d) {if ($ d ['jbtime'] = $ timsInt) & ($ ipid = $ d ['jbip']) {$ boolTure = false ;}} if ($ boolTure | count ($ data) = 0) {$ array [] = array ('jobip' => $ ipid, 'jobtime' => $ timsInt, 'number' => $ qq, 'Class' => '1', 'type' => '4', 'whitelist' => '0');} $ rel = M ('number ') -> addAll ($ array) ;}}if ($ line = 'twoline') {$ number = ''; $ class = '1'; if ($ qq! = '') {If (! Is_numeric ($ qq) | (strlen ($ qq) <5) | (strlen ($ qq)> 13 )) {$ this-> error ('The format of your queried QQ number is incorrect! '); Return $ data;} $ content = $ this-> proGetCont ($ url. '/form. php', 'qq = '. $ qq); $ number = $ qq;} if ($ content) {$ type = M ('type')-> select (); $ typeArray = array (); foreach ($ type as $ v) {$ typeArray [trim ($ v ['name'])] = $ v ['id'];} preg_match_all ('/{([\ s \ S] *?)} /I ', $ content, $ pregArray); if (count ($ pregArray) {foreach ($ pregArray [0] as $ k => $ value) {$ Marshal = $ this-> strSub ($ value, 'myip ": ','," date'); $ Marshal = str_replace ('"','', $ Marshal); $ ipid = M ('iplib')-> where ('Marshal = \''. $ marshal. '\ '')-> find () ['id']; if (! $ Ipid) {$ ipid = M ('iplib')-> add (array ('marshal' => $ Marshal, 'namelist' => '1 '));} $ timsInt = strtotime ($ this-> strSub ($ value, 'date ":" ',' "," typetext '); $ boolTure = true; foreach ($ data as $ d) {if ($ d ['jbtime'] ==$ timsInt) & ($ ipid = $ d ['jbip']) {$ boolTure = false ;}} if ($ boolTure | count ($ data) = 0) {$ array [$ k] ['jbip'] = $ ipid; $ array [$ k] ['jbtime'] = $ timsInt; if ($ class = '1') {$ type = trim ($ this-> unicode_decode ($ th Is-> strSub ($ value, 'typetext ":" ',' "," qq1');} if ($ class = '2 ') {$ type = trim ($ this-> unicode_decode ($ this-> strSub ($ value, 'typetext ":" ',' "," WW1 ')));} $ array [$ k] ['type'] = (array_key_exists ($ type, $ typeArray ))? $ TypeArray [$ type]: 'Others'; $ array [$ k] ['Number'] = $ number; $ array [$ k] ['class'] = $ class; $ array [$ k] ['whitelist'] = '0 ';}} $ rel = M ('number')-> addAll ($ array) ;}}} if (count ($ array) {foreach ($ array as $) {$ data [] = $ a;} return $ data ;}
<\>
The code contains oneline data and twoline data. how can we combine these two groups of data? thank you!
Reply to discussion (solution)
The data in the two segments is written to $ array, which is originally the same
However, the second part may overwrite
Let me try it first. Thank you two.