这样的问题,当我要上传照片时,总是会出现这样的代码
A PHP Error was encountered
Severity: Warning
Message: Illegal string offset 'file_name'
Filename: controllers/product.php
Line Number: 113
Backtrace:
File: C:\xampp\htdocs\test\application\modules\admin\controllers\product.php
Line: 113
Function: _error_handler
我该如何解决?谢谢
我的控制器
if(!empty($_FILES['photo']['name']))
{
$upload = $this->_do_upload();
$data['photo'] = $upload['file_name'];
}