No need for a function. You can create server flags dynamically like this:
PHP Code:
serverr.(@ a) = b;
Where
a is the name and
b is the content (duh). You just didn't assign anything to the flag in your example, which resulted in it not being created at all.