Array to string conversion cakephp

前端 未结 4 1416
抹茶落季
抹茶落季 2021-01-29 14:30

I\'m working on Cake PHP. Please give me a solution to solve this:

Controller.php:

public function test() {
    $this->set(\'users_l         


        
4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 15:08

    test.ctp:

    ";print_r($users_list);echo "
    "; ?>

    as the result of find will be an array so the above line will print all the elements of $user_list array, now you have to use this array according to your logic, for example you can use foreach() to get individual elements of this array.

    Hope the above explanation is enough for your understanding!

提交回复
热议问题