public function getUserData()
{
$temp = ['id','user_name', 'email'];
$user = [];
foreach($temp as $index){
$user->$temp = $this->attributes[$temp];
}
return $user;
}
Corrected :
public function getUserData()
{
$temp = ['id','user_name', 'email'];
$user = [];
foreach($temp as $index){
$user->$index = $this->attributes[$index];
}
return $user;
}
Reference:
http://stackoverflow.com/questions/2732451/php-how-do-i-fix-this-illegal-offset-type-error
No comments :
Post a Comment