Hi I am new to php and I just run into a problem. I would like to get local variable data outside the function after it was called.
function MyFunction() {
    $x = set
}
if($x == "set"){
    code...
}
Hi I am new to php and I just run into a problem. I would like to get local variable data outside the function after it was called.
function MyFunction() {
    $x = set
}
if($x == "set"){
    code...
}
 
    
    You can't do that. Instead return the value from the function.
function MyFunction() {
    $x = "set";
    return $x
}
if(MyFunction() == "set"){
    code...
}
