Home  >  Q&A  >  body text

How to merge two data and output them together? Please give me some guidance.

For example: how to combine these two arrays with one-time return output

$banner = Banner::all();

$channel = Channel::all();

柯伟超柯伟超2258 days ago1312

reply all(2)I'll reply

  • jesse

    jesse2018-09-06 13:03:30

    return ['banner'=>$banner, 'channel'=>$channel];

    Put two variable values ​​into an array and return it directly

    reply
    0
  • 柯伟超

    柯伟超2018-08-31 11:03:22

    For example: how to combine these two arrays with one-time return output

    //thinkphp

    $banner = Banner::all();

    $channel = Channel::all();


    reply
    0
  • Cancelreply