>> Delete Reply from No. 0 article
No. RE: 최근 이미지 파일 이름 알아내기

등록 2000-06-09 13:53:00     조회 4
이름 적수    

		사랑해 만화를 다운로드한 디렉토리에서 가장 최근의 그림을 읽어오는
아주 간단한 스크립트 :)
 <?
function lastimage() {
    $dir = "/data/사랑해/image";
     $d = opendir($dir);
    while ($file = readdir($d)) {
        $files<> = $file;
    }
    closedir($d);
     rsort($files);
     return $files[1];
}
 // 이건 그냥 사용 예제
echo("<IMG SRC="http://www.chosun.com/photo/news/".
     ereg_replace("^(......).*", "1", lastimage())."/".
     lastimage()."">");
?>
 lastimage() 라는 함수로 뺐으니까 아무대나 붙이기 쉬우실 꺼에요.
 예제 테스트는 http://linux.sarang.net/~redhands/sarang.php3 (언제 지울지 모릅니다.)
 --
아.지.사.바
[관리자] 패스워드를 입력 하십시오. 답장이 존재하면 함께 삭제됩니다.[ 목록 | 이전 ]
패스워드:    

Copyleft 1999-2026 by JSBoard Open Project
Theme Designed by IDOO All right reserved