if(preg_match("~\s*18\s*~u", $groupInfo[0]['name']))
$plus18 = "<img src="\"/images/18plus.png\"" style="\"position:" relative;top: -16px;padding-left: 3px;width: 25px;\" width="\"25px\"" data-toggle="\"tooltip\"" data-original-title="\"This" mark means that the community has an age restriction of 18+\">";
else $plus18 = "";
preg_match("~\s*(18|vulgar|sex|sex)\s*~u", .....
Find more questions by tags PHP