Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php,alt.comp.lang.php,alt.php Subject: Re: Newbie needs recommendation for fast learning a little php. Date: Thu, 1 Jul 2021 10:49:18 +0200 Lines: 57 Message-ID: References: <35nodg56nqinnfigtl6251fhlpkb42vb61@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net bbW7p8ZnuSrC0AixJDHzDAEVg/2giAR423A4kcA4K4zHwo28Mg Cancel-Lock: sha1:z3PyxQSmDUFtwMePeQgmX7pd4x0= In-Reply-To: Xref: csiph.com comp.lang.php:18703 alt.comp.lang.php:62 alt.php:3269 Not_even_a_newbie@example.net: > On Wed, 30 Jun 2021 15:09:57 +0200, Arno Welzel > wrote: [...] >> Much simpler: >> >> > echo "This file was last modified on: "; >> echo date("Y-m-d H:m",filemtime($_SERVER["SCRIPT_FILENAME"])); >> ?> > > Thanks for that. I've plugged this in and saved it as foo.php and I > get an odd reaction. The actual time stamp on the file is 13:22, but > the above script is telling me that the file was last modified at > 13:06. I suppose that the idiots at my Web host may have screwed up > something on the server. The 13:22 time is when I created the file, so > it can't be that it's showing when it was created and not when it was > modified. I'm scratching my head here. You can also try this to make sure the file system cache is emptied: And if this doesn't work, use a global cache clear: Also see: >> Also see: >> >> >> >> "'SCRIPT_FILENAME' >> >> The absolute pathname of the currently executing script." > > Okay, I don't understand what you mean in the piece immediately above > this. The above url seems to say that the script will just run. $_SERVER is a super global array which provides a number of runtime parameters of the current script. $_SERVER["SCRIPT_FILENAME"] contains the complete name of the current script including the path or the name which was passed at command line when using PHP as CLI. -- Arno Welzel https://arnowelzel.de