note 32355 added to function.dirname
| From: | philb at gmx dot net | Date: | Sun, 25 May 2003 01:37:15 +0000 |
| Subject: | note 32355 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48956@lists.php.net to get a copy of this message | ||
<?php
// if you like put this into an include file
function ShowDirModTime($FullPath) {
$BasePath = dirname ($FullPath);
$time = filectime($BasePath);
$time=time()-$time;
$weeks=$time/604800;
$days=($time%604800)/86400;
$hours=(($time%604800)%86400)/3600;
$minutes=((($time%604800)%86400)%3600)/60;
$seconds=(((($time%604800)%86400)%3600)%60);
$timestring='[ ';
if(round($days)) $timestring.=round($days)."d ";
if(round($hours)) $timestring.=round($hours)."h ";
if(round($minutes)) $timestring.=round($minutes)."m ";
if(!round($minutes)&&!round($hours)&&!round($days))
$timestring.="".round($seconds)."s ";
$timestring.=']';
echo $timestring;
}
?>
<?php
// execute like this...
echo "dir last updated ";
ShowDirModTime($HTTP_SERVER_VARS["PATH_TRANSLATED"]);
?>
----
Manual Page -- http://www.php.net/manual/en/function.dirname.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32355
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32355&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32355&report=yes