This has got to be an easy question - for some reason I can't seem to get
this to work. Is there a better way? All I want is a quick and dirty way
to populate a file with UNIX time stamps...
<?php
//viscount_helper .php
$vc = 'viscounter_tes t.txt';
$avdaily = 5; average daily
$total_count = (365 * $avdaily); //time period = one year
echo $total_count;
$interval = (86400)/$avdaily; //evenly spaced intervals
echo $interval;
$visit = time() - (31536000);
echo $visit;
//$next_time = ($first_time + $interval)
$fp = fopen($vc,"a");
for($i = 1; $i > $total_count; $i++)
{
fwrite($fp, $visit."\n");
$visit = $visit + ($interval * $i);
}
fclose($fp);
this to work. Is there a better way? All I want is a quick and dirty way
to populate a file with UNIX time stamps...
<?php
//viscount_helper .php
$vc = 'viscounter_tes t.txt';
$avdaily = 5; average daily
$total_count = (365 * $avdaily); //time period = one year
echo $total_count;
$interval = (86400)/$avdaily; //evenly spaced intervals
echo $interval;
$visit = time() - (31536000);
echo $visit;
//$next_time = ($first_time + $interval)
$fp = fopen($vc,"a");
for($i = 1; $i > $total_count; $i++)
{
fwrite($fp, $visit."\n");
$visit = $visit + ($interval * $i);
}
fclose($fp);
Comment