알짜게시판

[PHP] 지정 폴더 내 PHP 파일 최종 수정일 확인하기

웹사이트(PHP) 운영중 언제까지 수정을 했는지 확인하기 위해 만든 코드입니다.

지정 폴더에 php 파일의 날짜 중 제일 최근 날짜를 구합니다.

[code]
// 최종 수정날자 구하기
$cfg['path']['core'] = array('.', './admin');
foreach($cfg['path']['core'] as $path)
{
$dir = dir($path.'/');
while(false !== ($file = $dir->read()))
{
$ext = substr($file, strrpos($file, '.'));

if(in_array($ext, array('.php'))) $files[] = $path.'/'.$file;
}
}
$last = 0;
foreach($files as $file) if($last < filemtime($file)) $last = filemtime($file);

echo date(&#039;Y-m-d H:i:s&#039;, $last), &#039;- 최종 수정&#039;;
[/code]
번호 제목 글쓴이 조회 날짜
5 [그누보드] 임의로 테마설정하기 2,288 09-16
4 [워드프레스] 회원가입시 닉네임 필드 추가하기 2,266 09-21
3 [워드프레스] 단어 수정하기 2,162 05-19
열람 [PHP] 지정 폴더 내 PHP 파일 최종 수정일 확인하기 1,917 06-20
1 [Delphi] 권한상승 1,792 09-04
목록