$myArray = array();
function test(){
global $myArray;
$myArray[0] = 'value01';
}
test();
// echo $myArray[0]; // not working in modx
return $myArray[0]; // not working in modx
This question has been answered by BobRay. See the first response.
$myArray = array();
if (!function_exists('test')) {
function test($myArray){
$myArray[0] = 'value01';
return $myArray;
}
}
$myArray=test($myArray);
$myArray = array();
function test(&$myArray){
$myArray[0] = 'value01';
}
test($myArray);
// echo $myArray[0]; // not working in modx
return $myArray[0]; // not working in modx