Can one integrate PHP in Javascript?
<p>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 <code>Date</code> information from files stored on the server as follows (PHP):</p>

<pre><code>function getFileDate($file) {
  $time = filemtime($file);
  $date = date('d.m.y', $time);
  return $date;
}
</code></pre>

<p>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)?</p>

<p>Thanks for your help!</p>
