KarveR's example prints out the number of days in the current month (at execution time). If you want a different date you also have to pass a second argument that provides the date to be examined. There are many ways to supply that, as a UNIX timestamp, a string transformed into a date with strtotime() etc.