If I have a function like this:
function getTotal() {
$total = array("gcBalance" => 5, "gcTotal" => 10);
return $total;
}
Is there a way I can call the function and get the gcBalance value out of the array without having to loop? Ideally it would work something like this, but it doesn't.
$balance = getTotal()[0];
echo $balance;