The class diagram shows (as its name says) the classes which will be involved in your program. Talking about a virtual library you will have some classes called Book, User and so on. This diagram shows how those classes are connected, the multiplicity (1-1, 1-m,m-m..) and the fields that each class contains.
This diagram will help you to understand better how the objects will be connected, and make sure before start programming that there are no problems with your idea (and if you are working in a group, assure that everyone has the same idea regarding to the developing plan). If you develop your application in PHP, you could do it in an object oriented way, so you could easly design the diagram.
By asking you to do this diagrams, I think they assume you will do it object oriented. You may also like the take a look here: http://www.php.net/manual/en/language.oop5.php