PHP는 FixPath 함수 [경로 기능을 마무리]
FixPath 기능 :. PHP는 경로 함수는 정렬 더러운 경로를 수정합니다.
예 :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <? PHP는 Dirty paths: \n " ; "\ n \ n \ n 모두 더러운 경로 예 : \ n"에코; = 'C://////////Windows//////System' ; // C:/System $ 경로 [] =는 'C :////////// 윈도우 ////// 시스템'; / / C 조 : / 시스템 = 'C:\HTML\javascript\..\examples\colors.html' ; // C:/HTML/examples/colors.html $ 경로 [] = '에 C : \ HTML을 \ javascript를 \ .. \ 예제 \ colors.html'; / / C 조 : /는 HTML / 예제 / colors.html = '/root/./wwwroot/scripts/../././webpage' ; // /root/wwwroot/webpage $ 경로 [] = '/ 루트 /. / wwwroot에 / 스크립트 / ... /. /. / 웹페이지'; / / / 루트 / wwwroot에 / 웹페이지 = 'wwwroot/webpage/../index.php?querystring' ; // wwwroot/index.php?querystring $ 경로 [] = 'wwwroot에 / 웹페이지 / ... / index.php? 검색어'; / / wwwroot에 / index.php? 검색어 = 'http://www.php.net/manual/en/../../downloads' ; // http://www.php.net/downloads $ 경로 [] = 'http://www.php.net/manual/en/../../downloads'; / / http://www.php.net/downloads = 'http://www.php.net/downloads/test/test1/test2//./docs.php' ; // http://www.php.net/docs.php $ 경로 [] = 'http://www.php.net/downloads/test/test1/test2//./docs.php'; / / http://www.php.net/docs.php = '../downloads/../docs.php' ; // ../docs.php $ 경로 [] = '.. / 다운로드 / ... / docs.php'; / / ... / docs.php = 'localhost//projetos/../_arquivos/../' ; // "" $ 경로 [] = 'localhost를 / / projetos / ... / /../'; _arquivos / / "" = 'C:/downloads/../../../' ; // C:/ $ 경로 [] = '에서 C : / 다운로드 /../../../'; / / C 조 : / = 'downloads/../../../' ; // ../../ $ 경로 [] = '다운로드 /../../../'; / / ../../ $paths as $path ) $로하게 foreach ($ 경로 경로) ( "" . $path . "" = "" . fixpath ( $path ) . """ ; "\ n" "에코. $ 경로입니다." "=" ". fixpath ($ 경로)." ""; ) ?> |
참고 : "/ /"한 번만 더 슬래시 루트 롤백됩니다.
































