I have two functions in a class, how do I get the value of a variable that is inside a function and take advantage of that same variable in another function of the same class. I want to make the variable $ userFullname Global to be used in every class.
public function GetHtml($data)
{
$this->data = $data;
$quizinfo = $this->data['quizinfo'];
$quizinfo = (object) $quizinfo;
foreach ($this->data['users'] as $key => $user) {
$userFullname = $user['firstname'] . $user['lastname'];
}