标签:com return tp5 class find name type 数组 code
return 可以输出对象,但是不可以输出数组
class Index { public function index(Student $student) { $data = $student->find(25); dump($data); dump(gettype($data)); $arr = [‘name‘=>‘qiqi‘]; return ($data); //$data为对象 } }
输出:
-------------------------------------------------------------------------------------
class Index { public function index(Student $student) { $data = $student->find(25); dump($data); dump(gettype($data)); $arr = [‘name‘=>‘qiqi‘]; return ($arr); //$arr是一个数组 } }
输出:
标签:com return tp5 class find name type 数组 code
原文地址:https://www.cnblogs.com/qq254980080/p/10802676.html