OK -you went way out of your way not to use the code I posted the first time you asked.
https://www.ubbdev.com/forum/showthreaded.php/Number/114508The Group == '-5-' bit only works if they have one group. Most sites will have people as members of multiple groups.
So strstr is best. That searches for a pattern within strstr(haystack,needle)
So if the user's group is "-1-2-3-5-"
Then you could say:
if (strstr($Groups,"-5-")) {
// Would apply to anyone's string of groups containing "-5-"
}