Hi everyone, i am closing my recent problems with some code, this should be the last doubt, thanks for all the helpers in recent doubts that i created.
well, the code is here:
main.php
<?php
require_once 'functions.php';
$Var = 1;
$UserFunctions = new User();
$UserFunctions->MyVar();
?>
functions.php
class User {
public function MyVar() {
if ($Var == 1) {
echo "Yes";
}
else {
echo "no";
}
}
}
well, it give a error on functions.php and say “Undefined variable:Var”
This part is really very important, anyone can give me some help? Thanks community