PHP FixPath Fonction [fonction voie de finition]
FixPath Fonction: fixer les chemins sale. PHP voie fonction de tri.
Exemple:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <? Php ; echo "Dirty nnn chemins: n"; = 'C://////////Windows//////System' ; // C:/System $ Chemins [] = 'C :////////// ////// Windows System'; / / C: / Système = 'C:HTMLjavascript..examplescolors.html' ; // C:/HTML/examples/colors.html $ Chemins [] = "C: HTMLjavascript .. examplescolors.html '; / / C: / HTML / examples / colors.html = '/root/./wwwroot/scripts/../././webpage' ; // /root/wwwroot/webpage $ Chemins [] = "/ root /. / Wwwroot / scripts / .. /. /. / Page ', / / / root / wwwroot / page Web = 'wwwroot/webpage/../index.php?querystring' ; // wwwroot/index.php?querystring $ Chemins [] = 'wwwroot / page / .. / index.php? QueryString'; / / wwwroot / index.php? QueryString = 'http://www.php.net/manual/en/../../downloads' ; // http://www.php.net/downloads $ Chemins [] = '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 $ Chemins [] = 'http://www.php.net/downloads/test/test1/test2//./docs.php'; / / http://www.php.net/docs.php = '../downloads/../docs.php' ; // ../docs.php $ Chemins [] = '.. / downloads / .. / docs.php'; / / .. / docs.php = 'localhost//projetos/../_arquivos/../' ; // "" $ Chemins [] = 'localhost / / Projets / .. / _arquivos /../'; / / "" = 'C:/downloads/../../../' ; // C:/ $ Chemins [] = "C: / downloads /../../../'; / / C: / = 'downloads/../../../' ; // ../../ $ Chemins [] = '/../../../'; téléchargements / / ../../ $paths as $path ) foreach ($ chemins de $ path) ( . $path . "" = "" . fixpath ( $path ) . """ ; echo "n". "$ PATH". "=" ". fixpath ($ PATH)." ""; ) ?> |
Note: "/ /" un slash sera plus revenir à la racine.











































