If I have something like $data = getSomeData();
which is an associative array, and then I use things like $data['username']
and $data['id']
and so on, will it have to call getSomeData();
every time I use something from the array?
If I have something like $data = getSomeData();
which is an associative array, and then I use things like $data['username']
and $data['id']
and so on, will it have to call getSomeData();
every time I use something from the array?
no, the results of getSomeData()
are stored in $data
, so you are using the values in $data
.