My php is a little rusty but this is boggling my mind right now. I googled this and read all the stackoverflow questions I could find that looked related, but those all seem
if you don't want to use globals, you can jast use
function add_msg($msg) { echo "$msg"; } add_msg("test"); add_msg("test2");
function, the result will be the same.