Membership Pro – Protect Content VIA PHP

Hi — Is there a way to protect content via PHP? I have a view counter on the site that is placed there in the code and only want to display the content for members in a certain group?