Variables in arrays?

i was wondering if its possible to have variables in arrays…and if so, how to do it? this is what i have right now:

$galleries = array(array("name" => $gallery1, 
						 "id" => 0), 
						 array("name" => $gallery2, 
						 "id" => 1));
foreach($galleries as $name) {

where “getTitle();” is a function i call on from another script…but all thats important now is that this code doesn’t seem to be working…but i DO need to store a variable and an id number for that variable in an array as i have above.