I am trying to change a variable that is outside of a function, from within a function. Because if the date that the function is checking is over a certain amount I need it
Try this pass by reference
$var = "01-01-10";
function checkdate(&$funcVar){
if("Condition"){
$funcVar = "01-01-11";
}
}
checkdate($var);
or Try this same as the above, keeping the function as same.
$var = "01-01-10";
function checkdate($funcVar){
if("Condition"){
$funcVar = "01-01-11";
}
}
checkdate(&$var);