if you google for php cron, there are oodles and oodles of examples. for me, I usually just put the cron in /etc/cron.daily or whichever crondirectory was appropriate...then start your script with:
#!/usr/local/bin/php -q
This tells where php is located. the -q supresses the html output. After that, you have your php tags and code.
so it would look something like:
#!/usr/local/bin/php -q
<?php
print "this is my automatic cron thing";
print "isnt this neat";
?>