You can enter the channels allowed into a variable and use that in your $istok() instead of hard coding the channels. Just keep in mind that there is a limit to a variable's length, so if you're expecting many channels, that won't work. Other options include saving the channels to a file or putting them into a hash table. You could do other things as well, but those would do the trick.