Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Laravel Lucid 框架,我必须setAttribute显式调用模型,但出现以下错误:
setAttribute
ErrorException:数组到字符串的转换
代码是
$user = new User; $user->setAttribute('email',$this->email); print_r($user);exit();
请帮忙
谢谢
尝试使用 implode() 方法?:
$test = implode('', $array); $user = new User; $user->setAttribute('email', $test); print_r($user); exit();