Eric @ EricBess WebHome

Plutôt que de la réflexion, sachant qu'il n'aurait pas de sens

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

PHP FixPath Fonction [fonction voie de finition]

FixPath Fonction: fixer les chemins sale. PHP voie fonction de tri.
Exemple:

? Afficher le code PHP
 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 . "&quot;  =  &quot;" .  fixpath ( $path ) . "&quot;" ; echo "n". "$ PATH". "=" ". fixpath ($ PATH)." ""; 
  ) 
  ?> 
Note: "/ /" un slash sera plus revenir à la racine.

Cliquez ici pour lire la suite

17 juillet 2008 Posté par Eric | Codage | aucun commentaire

Fonction FindRelativePath [chemin pour trouver la relation entre le parent]

Fonction PHP: trouver le rapport entre le chemin d'accès.
Fonction PHP: trouver le chemin entre la relation parent.

Exemple:

? Afficher le code PHP
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
  <? Php 
  'http://www.php.net/manual/en/install.php' ; Path_a $ = 'http://www.php.net/manual/en/install.php'; 
  'http://www.php.net/downloads' ; Path_b $ = 'http://www.php.net/downloads'; 

  Path A:  " . $path_a ; echo "\ n Un chemin:". path_a $; 
  Path B:  " . $path_b ; echo "\ n Path B:". path_b $; 
  A to B:  " .  findRelativePath ( $path_a , $path_b ) ; //  ../../downloads/ echo "\ n A à B:". findRelativePath ($ path_a, path_b $) / / .. / .. / downloads / 
  B to A:  " .  findRelativePath ( $path_b , $path_a ) ; //  ../manual/en/install.php echo "\ n B à A:". findRelativePath ($ path_b, path_a $) / / .. / manual / fr / install.php 
  ?> 

Fonction:

Cliquez ici pour lire la suite

17 juillet 2008 Posté par Eric | Codage | 2 commentaires