嵌入变量值以形成新变量

I have a variable $var that can only be set to, let's say, a or b. I have two global arrays, e.g. $aNames and $bNames. Finally there's also a variable $number. To bring everything together, I'd like to combine the values to get an element from the array.

Example:

$var = 'a';
$number = 2;
$el = "$$var"."Names[".$number."]";

$el == $aNames[2] // true

But I'm not sure how to write that first $el line without it being interpreted as a string.

This would do:

$el = ${$var.'Names'}[$number];

Example:

<?php
$aNames[2] = 10;
$var = 'a';
$number = 2;
$el = ${$var.'Names'}[$number];
echo $el; //10

and now

$el == $aNames[2]

will evaluate to true