Eric @ EricBess WebHome

Domāšanas akli bez pasākumiem, būs neapzināti kļūst bezjēdzīgas

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 Function [ceļa apdares amats]

FixPath Amats: noteikt netīriem ceļiem. PHP ceļu apdares funkciju.
Piemērs:

 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
  <? Php 
  ; echo "nnn Dirty ceļus: n"; 
  = 'C://////////Windows//////System' ; //  C:/System $ Ceļus [] = 'C :////////// Windows ////// System ", / / C: / System 
  = 'C:HTMLjavascript..examplescolors.html' ; //  C:/HTML/examples/colors.html $ Ceļus [] = 'C: HTMLjavascript .. examplescolors.html'; / / C: / HTML / piemēri / colors.html 
  = '/root/./wwwroot/scripts/../././webpage' ; //  /root/wwwroot/webpage $ Ceļus [] = '/ root /. / Wwwroot / skriptus / .. /. /. / Webpage'; / / / root / wwwroot / webpage 
  = 'wwwroot/webpage/../index.php?querystring' ; //  wwwroot/index.php?querystring $ Ceļus [] = 'wwwroot / webpage / .. / index.php? Querystring'; / / wwwroot / index.php? Querystring 
  = 'http://www.php.net/manual/en/../../downloads' ; //  http://www.php.net/downloads $ Ceļus [] = '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 $ Ceļus [] = 'http://www.php.net/downloads/test/test1/test2//./docs.php'; / / http://www.php.net/docs.php 
  = '../downloads/../docs.php' ; //  ../docs.php $ Ceļus [] = '.. / downloads / .. / docs.php'; / / .. / docs.php 
  = 'localhost//projetos/../_arquivos/../' ; //   "" $ Ceļus [] = 'localhost / / projetos / .. / _arquivos /../'; / / "" 
  = 'C:/downloads/../../../' ; //  C:/ $ Ceļus [] = 'C: / downloads /../../../'; / / C: / 
  = 'downloads/../../../' ; //  ../../ $ Ceļus [] = 'downloads /../../../'; / / ../../ 

  $paths as $path ) foreach ($ ceļus  $ ceļā) 
  ( 
      . $path . "&quot;  =  &quot;" .  fixpath ( $path ) . "&quot;" ; echo "n" "." $ ceļš. "" = "". fixpath ($ ceļu). "" "; 
  ) 
  ?> 
Piezīme: "/ /" vēl viens slashes būs roll atpakaļ root.

Click to turpināt rīdinga

Jūlijs 17, 2008 Posted by eric | Koda | no comments

FindRelativePath Function [ceļa atrast sakarību starp relatīvo]

PHP funkcija: Found relatīvo starp ceļu.
PHP funkcija: noteikt relatīvo saistību starp ceļu.

Piemērs:

 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" Ceļš A: ". $ path_a; 
  Path B:  " . $path_b ; echo "\ n" Ceļš B: ". $ path_b; 
  A to B:  " .  findRelativePath ( $path_a , $path_b ) ; //  ../../downloads/ echo "\ n A uz B:". findRelativePath ($ path_a, $ path_b); / / .. / .. / downloads / 
  B to A:  " .  findRelativePath ( $path_b , $path_a ) ; //  ../manual/en/install.php echo "\ n B uz A:". findRelativePath ($ path_b, $ path_a); / / .. / manual / en / install.php 
  ?> 

Amats:

Click to turpināt rīdinga

Jūlijs 17, 2008 Posted by eric | Koda | 2 komentāri