Giving my function access to outside variable
- by brett
I have an array outside:
$myArr = array();
I would like to give my function access to the array outside it so it can add values to it
function someFuntion(){
$myVal = //some processing here to determine value of $myVal
$myArr[] = $myVal;
}
How do I give the function the right scoping to the variable?