Is there any other way to output the specified value besides the index method? {Code...} outputs the specified value. Are there other methods besides the index method?
Public function index () {$ new = $ this-> index_com (); // output the specified echo $ new [2];} public function index_com () {$ list = 'a'; $ category = 'B'; $ totalCount = 'C'; $ current = 'D'; return array ($ list, $ category, $ totalCount, $ current );}
Reply content:
Is there any other way to output the specified value besides the index method?
Public function index () {$ new = $ this-> index_com (); // output the specified echo $ new [2];} public function index_com () {$ list = 'a'; $ category = 'B'; $ totalCount = 'C'; $ current = 'D'; return array ($ list, $ category, $ totalCount, $ current );}
It can also be a dictionary,
Public function index () {$ new = $ this-> index_com (); // output the specified echo $ new [list];} public function index_com () {$ list = 'a'; $ category = 'B'; $ totalCount = 'C'; $ current = 'd; return array ('LIST' => $ list, 'category '=> $ category );}
Public function index () {$ new = $ this-> index_com ($ k); // output the specified echo $ new;} public function index_com ($ k) {$ arr = ['LIST' => a, 'category '=> 'C']; return $ arr [$ k];
You can use the list syntax to achieve the desired effect:
Public function index () {list ($ list, $ category, $ totalCount, $ current) = $ this-> index_com (); // output the specified echo $ category ;} public function index_com () {$ list = 'a'; $ category = 'B'; $ totalCount = 'C'; $ current = 'D'; return array ($ list, $ category, $ totalCount, $ current );}