Code snippet below:

myvar=something
varname=myvar
echo ${!varname}