I've a webpage, which is currently completely build with PHP. Now, it would be great if it works on my local machine outside the web server, too. I figured out, that most of the stuff is just client side operations. I can easily rewrite them using Javascript. However, at one point, I am reading Date
information from files stored on the server as follows (PHP):
function getFileDate($file) {
$time = filemtime($file);
$date = date('d.m.y', $time);
return $date;
}
Is it possible to integrate that call into Javascript? And, can I implement some kind of switch, so that it will only be executed on my local machine (maybe replaced by a dummy date)?
Thanks for your help!