I currently have 2 functions; i need to read one array that's inside one of the functions from the inside of the other function:
function a(){
foreach ($options as $option){ // $options is a variable from function b()
// here goes a really long loop
}
}
function b(){
$options[] = array(
'key1' => 1,
'key2' => 2,
'key3' => 3,
);
function a(); // run function here?
}
My php file is gonna have multiple copies of what we call "function b()". And inside each function b(), i wanna run function a(), but use the array content that's inside the function b().
function a() contains a loop that's always the same but really long, i just want to keep my code as short as possible instead of copying function a() inside each function b().
This is probably really easy but i've been struggling with this issue for a long time now!