<?php $arr = array( 'derp', 'test', 'othershit' ); $someUnknowableTemplate = "the first var is @VAR0, the third is @VAR2"; echo preg_replace('/@VAR(\d)/e','$arr[\1]',$someUnknowableTemplate);
You have javascript disabled. You will not be able to edit any code.