update variable on the fly php