I'm an extreme N00B but I've found some code which is supposed to write the current time into a txt file. The txt file shows up , but only with the number "1" written in it. It doesn't include the time as it should.
<?php
$myfile = "lastrun.txt";
$fh = fopen($myfile, "w") or die("can't open file");
$data = print date("H:i");
fwrite($fh, $data);
fclose($fh);
?>
For some reason though, I DO get the time showing in my browser window when i run this, but only the number "1" gets put into lastrun.txt.
Any ideas!? I'm stuck!