首页 > 解决方案 > How to remove last value in an from an object in php

问题描述

I am trying to make a more secure login process for my new website, I am using the MVC model in PHP, so this is a snippet of the code

$userData = $app->UserDetails($user_id); 
            $_SESSION['loggedin'] = TRUE;
             array_pop($userData);
             $_SESSION['userData'] = $userData;
            $_SESSION['user_id'] = $user_id; // Set Session

$app is actually an object that I created and here is the error that occurs when I try to login, can anyone help me please

Warning: array_pop() expects parameter 1 to be array, object given in C:\xampp\htdocs\ibuy_e-commerce\accounts\index.php

标签: php

解决方案


推荐阅读