In PHP one can use variable variables...
For example...
class obj { } $fieldName = \"Surname\"; $object = new obj(); $object->Name = \"John\"; $objec
I think regex is the way to go, and as far as I can remember the restrictions are:
so the regex would be "/[a-zA-Z]+[0-9a-zA-Z_]*/" - off the top of my head so your milage may vary.