I was wondering if you can make a plugin or something where we can input codes and it would shoot us back a variable to replace it. Like if I put PHP code in it and save it and make like a variable/shortcut so it would only be like {$menu} rather than putting the extended code in the header template. I want to make it a little bit cleaner this way. And if I can, can you please tell me how?

See I want this code to be put in my headers template so it would be on every page but if I just add the code there it would come up an error on my forums.