Re: Newbie needs recommendation for fast learning a little php.

"J.O. Aho" <[email protected]> Wed, 30 Jun 2021 16:24:38 +0200
Newsgroups comp.lang.php,alt.comp.lang.php,alt.php
Message-ID <[email protected]>
On 30/06/2021 14.08, [email protected] wrote:
> This does what I want, but only as a .PHP file. How do I get it into a
> file named foo.html so I can have foo.html declare when it was last
> modified?
> 
> <?php
> $file = $_SERVER["SCRIPT_NAME"];
>      $break = Explode('/', $file);
>      $pfile = $break[count($break) - 1];
> //echo $pfile;
> echo "This file was last modified on: " .date("Y-m-d
> H:m",filemtime($pfile));
> ?>
> 
> I feel as if I'm almost there.

I won't comment on the code as Arno already done that, there is two 
options, I would say one option is not up to you, so in reality you have 
only one option (the last one)

1. Make the webserver to send .html files to tne php engine as it does 
with the .php files.

2. Rename the .html file to .php


-- 

  //Aho