Solution 1:
Yes, you can use a variable named $Function, but you need the dollar sign. Without it, PHP interprets Function as a reserved word or constant.
if (isset($Function)) {
if ($Function == 'A') {
$functionID = '4';
} elseif ($Function == 'B') {
$functionID = '11';
}
} else {
$functionID = 0;
}
Key Points:
Function vs $Function
Function → reserved word in PHP.
$Function → a variable.
Other variations:
“Function” → string.
Some_Function → constant (if defined).
Some_Function() → function call.
✅ Always use the dollar sign when referring to a variable to avoid syntax errors.