This is nothing exciting, but I just wanted to share :-)
If you want to put in your php web page the well known "Last Modified:
<?php
echo "<b>Last modified:</b> " .
date( "F d, Y. H:i:s a", filemtime("YOUR FILENAME") );
?>
where, of course, you must substitute YOUR FILENAME with the filename of your web page.
That's it!
4 comments:
Wow, Php, I am now learning how to program...
You can simply use the constant __FILE__ to refer to the current file.
This is also useful to determine the path your PHP app is running from... you can simply use $app_root = dirname(__FILE__);
Yes you're right!
It's that I'm using this code in a php script where I include an html which contains the actual page: I modify the html page and not the php file, thus I don't use __FILE__ but the name of the .html.
By the way, I liked your blog, Xavier! :-)
PHP is not a programming language, it is a server script
Post a Comment