UPDATE:
This question exposed the obsolete, worst approach for visitors count and it should be avoided by everyone out there. Use sophis
Since I didn't find a satisfying "simple enough" solution, I came up with my own. Create an empty file called ip.txt and use this somewhere in your code:
$ip_all = file("ip.txt");
$ip_cur = $_SERVER['REMOTE_ADDR']."\n";
if (!in_array($ip_cur, $ip_all)) {
$ip_all[] = $ip_cur;
file_put_contents("ip.txt", implode($ip_all));
}
echo "visitors: " . count($ip_all);
Note that this file will can get somewhat large over time depending on the amount of visitors you get since the entries don't expire and get deleted like cookies. But as already mentioned, I wanted it to be as simple as possible and don't care about that. Also I don't want to rely on cookies because I doubt web-crawlers and other robots will send them back.