I have written a drupal module. One of the functions in the module is a hook function which has a function name of the form: hook_form_FORM_ID_alter, where the part FORM_ID depends on the the id of the form I want to alter. The form ids of the form I want to alter are stored in the database as persistent variables and what I want is to be able to use these to give the name of the function when I declare it.
My form id array might change at any time, what hook_form_FORM_ID_alter does should be the same for each form, so I would like only the function name in the function definition to change depending on the content of the form id array. I tried googling for something like dynamic function definition, but this didn't seem to be what I was after.
I know I could easily use hook_form_alter and then simply check the id every time, but I'd rather do it this way if it's possible.