how can convert $files contain to array?

后端 未结 6 1383
[愿得一人]
[愿得一人] 2020-12-11 14:01

How do I solve this error?

A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: admin/tour.php
Line Numbe         


        
6条回答
  •  半阙折子戏
    2020-12-11 14:36

    Are you sure that you get an array? is see several return FALSE. So you should check,

    if ($files !== FALSE)
    

    or casting it to an (empty) array (if false returns) with

    $files = (array) $this->multi_upload->go_upload();
    

提交回复
热议问题