Eric @ EricBess WebHome

Thinking aveuglément, sans action, il est devenu vide de sens sans le

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

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

Php function: A trouvé le rapport entre le chemin d'accès.
PHP fonction: d'identifier l'importance relative des relations entre le chemin d'accès.

Exemple:

[Copie dans le presse-papier] Voir 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:

[Copie dans le presse-papier] Télécharger FRPath.php
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 11 
 12 
 13 
 14 
 15 
 16 
 17 
 18 
 19 
 20 
 21 
 22 
 23 
 24 
 25 
 26 
 27 
 28 
 29 
 30 
 31 
 32 
 33 
 34 
 35 
 36 
 37 
  <? Php 
  $path_1 , $path_2 ) fonction findRelativePath (path_1 $, $ path_2) 
  ( 
      $path_1 == "" || $path_2 == "" ) if ($ path_1 == "" | | $ path_2 == "") 
      ( 
          ; return false; 
      ) 

      "/^(\\/|\w:\\/|https?:\\/\\/[^\\/]+\\/)?(.*)$/i" , $path_1 , $matches_1 ,  PREG_SET_ORDER ) ; preg_match_all ( "/ ^ (\ \ / | \ w: \ \ / | https?: \ \ / \ \ / [^ \ \ /] + \ \ /)?(.*)$/ i", $ path_1, $ matches_1, PREG_SET_ORDER); 
      "/^(\\/|\w:\\/|https?:\\/\\/[^\\/]+\\/)?(.*)$/i" , $path_2 , $matches_2 ,  PREG_SET_ORDER ) ; preg_match_all ( "/ ^ (\ \ / | \ w: \ \ / | https?: \ \ / \ \ / [^ \ \ /] + \ \ /)?(.*)$/ i", $ path_2, $ matches_2, PREG_SET_ORDER); 

      $matches_1 [ 0 ] [ 1 ] != $matches_2 [ 0 ] [ 1 ] ) if ($ matches_1 [0] [1]! = $ matches_2 [0] [1]) 
      ( 
          ; return false; 
      ) 

      explode ( "/" , $matches_1 [ 0 ] [ 2 ] ) ; $ Path_1_parts = explode ( "/", $ matches_1 [0] [2]); 
      explode ( "/" , $matches_2 [ 0 ] [ 2 ] ) ; $ Path_2_parts = explode ( "/", $ matches_2 [0] [2]); 

      isset ( $path_1_parts [ 0 ] ) && isset ( $path_2_parts [ 0 ] ) ) while (isset ($ path_1_parts [0]) & & isset ($ path_2_parts [0])) 
      ( 
          $path_1_parts [ 0 ] != $path_2_parts [ 0 ] ) if ($ path_1_parts [0]! = $ path_2_parts [0]) 
          ( 
              break; 
          ) 

          $path_1_parts ) ; array_shift (path_1_parts $); 
          $path_2_parts ) ; array_shift (path_2_parts $); 
      ) 

      $i = 0 , $path = "" ; $i < count ( $path_1_parts ) - 1 ; $i ++ ) for ($ i = 0, $ path = ""; $ i <count ($ path_1_parts) - 1; $ i + +) 
      ( 
          "../" ; $ Path .= "../"; 
      ) 
      . implode ( "/" , $path_2_parts ) ; return $ path. implode ( "/", $ path_2_parts); 
  ) 
  ?> 
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Chargement ...
- Bienvenue avis sur cet article

Related Log

Dans ce document, les lecteurs sont également préoccupés par le texte suivant:

  • N / A

17 juillet 2008 Auteur: eric | Coding | Trackback | 2 commentaires | Email This Post Print This Post | 49 vues

Ajouter un commentaire

Laissez une réponse

Hide Post Comments
  1. Traver posté le 2008-09-02 à la suite 12:04 am.

    Je voudrais demander quel est l'éditeur de code des plug-ins à réaliser au titre de la peine de dire Merci

    Répondre
    1. eric posté le texte suivant sur le 2008-09-02 à 12:41 am.

      wp-codebox

      Répondre