PHP FixPath Función [ruta función de acabado]
FixPath Función: fijar los caminos sucios. PHP camino función de la clasificación.
Ejemplo:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <? Php ; echo "nnn sucios caminos: n"; = 'C://////////Windows//////System' ; // C:/System $ Caminos [] = 'C :////////// ////// Windows System; / / C: / Sistema de = 'C:HTMLjavascript..examplescolors.html' ; // C:/HTML/examples/colors.html $ Caminos [] = 'C: HTMLjavascript .. examplescolors.html'; / / C: / HTML / ejemplos / colors.html = '/root/./wwwroot/scripts/../././webpage' ; // /root/wwwroot/webpage $ Caminos [] = '/ root /. / Wwwroot / scripts / .. /. /. / Página web' / / / root / wwwroot / página web = 'wwwroot/webpage/../index.php?querystring' ; // wwwroot/index.php?querystring $ Caminos [] = 'wwwroot / web / .. / index.php? QueryString'; / / wwwroot / index.php? QueryString = 'http://www.php.net/manual/en/../../downloads' ; // http://www.php.net/downloads $ Caminos [] = '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 $ Caminos [] = 'http://www.php.net/downloads/test/test1/test2//./docs.php'; / / http://www.php.net/docs.php = '../downloads/../docs.php' ; // ../docs.php $ Caminos [] = '.. / descargas / .. / docs.php'; / / .. / docs.php = 'localhost//projetos/../_arquivos/../' ; // "" $ Caminos [] = 'localhost / / Proyectos / .. / _arquivos /../'; / / "" = 'C:/downloads/../../../' ; // C:/ $ Caminos [] = 'C: / descargas /../../../'; / / C: / = 'downloads/../../../' ; // ../../ $ Caminos [] = 'descargas /../../../'; / / ../../ $paths as $path ) foreach ($ caminos como $ PATH) ( . $path . "" = "" . fixpath ( $path ) . """ ; echo "n". "$ PATH". "=" ". fixpath ($ PATH)". ""; ) ?> |
Nota: "/ /" uno más barras de lograr la regresión de la raíz.











































