The variable is not in function scope. You can achieve that by using global
keyword. However doing it like this is bad practice and you should rather pass the value to function through function parameter.
Use of global
(bad practice):
$objects["settings"]["template"]["value"] = "yes";
function testfunction() {
global $objects;
echo "<br />function output: ".$objects["settings"]["template"]["value"];
}
testfunction();
Passing value through function parameter:
$objects["settings"]["template"]["value"] = "yes";
function testfunction($objects) {
echo "<br />function output: ".$objects["settings"]["template"]["value"];
}
testfunction($objects);