I have a function that returns an array but for some things I only need one of the values from that array. Here is the function:
function url_vars() {
$bank = strtolower($_GET['bank']);
$bank = str_replace(',', '', $bank);
$bank = str_replace(' ', '_', $bank);
$type = $_GET['type'];
$term = $_GET['term'];
return array(
bank => $bank,
type => $type,
term => $term,
term_yrs => $term / 12
);
}
I tried to target one value from another function with $bank = url_vars()['bank']; but this seems to be incorrect as it is not working. How can I target a single value from this array? What is the correct way to do that?
'around those array keys inarray()...