"<%$var_list[$i]%>"
Well, the only thing that needs to be escaped there is the '$', but I don't know if you want to escape that, or want to use the variable...
$$var_list[$i]
Are you sure that's not wrong? PHP doesn't know if you mean:
${$var_list[$i]}
or
{$$var_list}[1]
so yeah, there is an error there, too.
Diego