public function recommend() { $userid = self::get_user(); $recommend = new Recommend($userid); $recomdata = $recommend->currentrecommend(); while ($rowsrecom = $recomdata->fetch_object()) { $avatarUrl = (object) $recommend->getavatar($rowsrecom->fromid); $this->data = $rowsrecom; $arrCount = (array) $avatarUrl; $arrData = (array) $this->data; $this->recommenddata[] = (object) array_merge($arrCount, $arrData); } // echo "<pre>"; // print_r($this->recommenddata);exit; }