I got a class user with a function that returns user info from a database
example:
class User {
public function get userInfo() {
return $users;
}
}
An object of class user is made when the user logs in.
Now I need that function on other pages as well but whats the best way to do this?
Option 1: Create a object of class user and store that object in a $_SESSION variable?
Option 2: Take the function out of the class and put in a seperate php file?