- <?php
- echo realpath("./");
- // /www/testphp
- ?>
--------------------------------------------------------------------------------------------
string realpath ( string $path )
2. 라인
상대경로를 절대경로로 반환합니다.
※주위(출처 - phpschool)
어떤 특정한 디렉토리를 기준으로 절대경로를 만들고자 할때
대상과 베이스와의 경로가 틀리게 되면 다른 결과가 나오는 경우도 있습니다.
ex)
/home/content/html/xxxxxxxxx/index.php <-- realpath()
/var/chroot/home/content/html/ <-- document_root
'php5 > 파일관련함수' 카테고리의 다른 글
도메인 상태 확인 - resource fsockopen ( string $hostname ) (0) | 2014.01.29 |
---|---|
파일 목록 배열 반환 - array scandir ( string $directory ) (0) | 2014.01.10 |
파일 출력과 길이 반환 - int readfile ( string $filename ) (0) | 2014.01.10 |
파일 업로드 관련 함수 (예제없음) (0) | 2014.01.10 |
파일 실행 가능 확인 - bool is_executable ( string $filename ) (0) | 2014.01.10 |