Hi Bono,
In PHP, you can dynamically set pointers to variables. i.e.:
<?php
$abc = "hello world";
$def = "abc";
print $$def;
?>
That would print out:
hello world
Without giving you the answer, i think this might be very helpful, if i understand well what you try to do.