The code has oneline data and twoline data, how to combine the two sets of data together?

Source: Internet
Author: User
Tags addall
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);p Reg_match_all ('/([\s\s]*?) <\/tr>/i ', $content, $pregArray), if (count ($pregArray)) {foreach ($pregArray [0] as $value) {Preg_match_all ('/
 
  /I ', $value, $v); $ipVal = $this->strsub ($v [0][3], ' fa ' > ', '$ipid = M (' iplib ')->where (' Ipval = \ '. $ipVal. ' \ ')->find () [' ID '];if (! $ipid) {$ipid = M (' iplib ')->add (Array (' ipval ' = = $ipVal, ' 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 (' jbip ' = = $ipid, ' jbtime ' = + $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 QQ number you queried is malformed! '); 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) {$ipVal = $this->strsub ($ Value, ' Myip ': ', ', ' Date '), $ipVal = Str_replace (' "', ' ', $ipVal), $ipid = M (' iplib ')->where (' ipval = \ ') $ipVal. ' \ ')->find () [' ID '];if (! $ipid) {$ipid = M (' iplib ')->add (Array (' ipval ' = = $ipVal, ' 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 = tr Im ($this->unicode_decode ($this->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]: ' Other '; $array [$k] [' number '] = $number; array[$k [' class '] = $class; $array [$k] [' whitelist '] = ' 0 ';}} $rel = M (' number ')->addall ($array);}}} if (count ($array)) {foreach ($array as $a) {$data []= $a;}} return $data;}
 

The code contains oneline data and twoline data, how to put these two sets of data together, thank you!


Reply to discussion (solution)

 
  

Two pieces of data are written in the $array.
But the second paragraph might cover the first paragraph.

I'll try it first, thanks to two people.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.