I want to create a value for a variable $user_role->role_id in php.Is it possible to create a variable as $user_role->role_id which can be parse in php I have tried as
$user_role=array();
$user_role->role_id='1';
getting error in
print_r($user_role->role_id);
error I got
Attempt to assign property of non-object
$user_role = new App\RoleIf you want to populate an array then you just do$user_role['role_id'] = 1;.