PHP Tutorial: A counter is an essential part of any website. In this tutorial we will use PHP to create our own counter. Given that not everyone has access to a database, this tutorial will save the hits to a .dat file.