Пример #1
0
 public function display()
 {
     echo "<pre>";
     print_r("======================Group Array Demo===================");
     echo "</pre>";
     $parser = ArrayParser::instance();
     $dataArray = $this->_getData();
     $firstData = $parser->groupArrayByIdFirstStyle($dataArray);
     $secondData = $parser->groupArrayByIdSecondStyle($dataArray);
     echo "<pre>";
     print_r($dataArray);
     echo "</pre>";
     echo "<pre>";
     print_r($firstData);
     echo "</pre>";
     echo "<pre>";
     print_r($secondData);
     echo "</pre>";
 }
Пример #2
0
 public function display()
 {
     echo "<pre>";
     print_r("======================Array and Object Demo===================");
     echo "</pre>";
     $parser = ArrayParser::instance();
     $associateArray = $this->_getData();
     $firstData = $parser->convertAssociateArrayToObjectFirst($associateArray);
     $secondData = $parser->convertAssociateArrayToObjectSecond($associateArray);
     echo "<pre>";
     print_r($associateArray);
     echo "</pre>";
     echo "<pre>";
     print_r($firstData);
     echo "</pre>";
     echo "<pre>";
     print_r($secondData);
     echo "</pre>";
 }