PHP For Displaying Membership Levels For User

As part of the template for our website, I would like to be able to display the Membership Level(s) that a user belongs to once they have logged in. Also, if possible, when their subscription expires. Is there a suggested method for accomplishing this? Thank you.