편집을 취소할 수 있습니다. 이 편집을 되돌리려면 아래의 바뀐 내용을 확인한 후 게시해주세요.
최신판 | 당신의 편집 | ||
18번째 줄: | 18번째 줄: | ||
<?php | <?php | ||
function get_cwd_depth() { | function get_cwd_depth() { | ||
return count(explode('/', | $cwd = getcwd(); | ||
if( $cwd == '/' ) return 0; | |||
return count(explode('/',$cwd))-1; | |||
} | } | ||
echo get_cwd_depth()."\n"; | echo get_cwd_depth()."\n"; |