Here's a very simple, but very complete, PHP script to print out a calendar. It does one thing, but does it well (which is how it should be). Neat bonus features include the ability to link certain days in the calendar to a web page - useful for a weblog. You can also assign stylesheet classes to specific days, and provide content for an individual day.
To use this code, just save the script to your server, include() it in your code, and display the output of generate_calendar().