Use crontab -e to open crontab editor and use this. I don't know what php -q does, so I did not use it below, but you probably could. And the top line (#!/usr/local/lib/php -q) has no place in a crontab-file.
Although Indo1144's example will work fine with the OS being used on his/her computer, it may not on yours (which is why you should state the OS and version you are using in all questions). Check your man pages for cron or crontab that the 'steps' can be used (where indo1144 used /15 for every 15 minutes).