Keep the number of times in the cookie. If there's no cookie, then it means that the user hasn't been there before, so set a new cookie with count 1. If the cookie exists, get the value from the cookie and increment it and output it to the user.
To set a cooke, use the setcookie() function. To retrieve info from a cookie, use the $COOKIE array. If your cookie name is 'visits', then the value is going to be in $COOKIE['visits']
HTH,
Diego