Rapide Advanced Adulte
 
 Web|Image|Shop|Video|News|Wmx|Mobile|Wiki|Ajouter ce moteur

     Manuel PHP     
Partager
 
 
Partager
Partager

 

Table :

.udm add search limit
.udm alloc agent array
.udm alloc agent
.udm api version
.udm cat list
.udm cat path
.udm check charset
.udm check stored
.udm clear search limits
.udm close stored
.udm crc32
.udm errno
.udm error
.udm find
.udm free agent
.udm free ispell data
.udm free res
.udm get doc count
.udm get res field
.udm get res param
.udm hash32
.udm load ispell data
.udm open stored
.udm set agent param
 
   

  udm_cat_path  


udm_cat_path

(PHP 4 >= 4.0.6, PHP 5 <= 5.0.4)

udm_cat_path -- Lit le chemin de la catégorie courante

Description

array udm_cat_path ( resource agent, string category )

udm_cat_path() retourne un tableau listant les catégories depuis la racine jusqu'à la catégorie courante. Le paramètre agent est un identifiant de résultat, obtenu après un appel à udm_alloc_agent.

category - La catégorie courante : celle dont on veut le chemin.

udm_cat_path() retourne un tableau avec le format suivant :

Le tableau est constitué de paires. Les index pairs contiennent les chemins de catégories, les index impairs les noms des catégories correspondantes.

Par exemple, l'appel $array=udm_cat_path($agent, '02031D'); peut retourner le tableau suivant :

$array[0] contiendra ''
 $array[1] contiendra 'Root'
 $array[2] contiendra '02'
 $array[3] contiendra 'Sport'
 $array[4] contiendra '0203'
 $array[5] contiendra 'Foot'
 $array[4] contiendra '02031D'
 $array[5] contiendra 'PSG'

Exemple 1. Spécifier une catégorie avec un format hiérachisé

<?php
//Spécifier le chemin de la catégorie courante avec le format suivant
// '> Root > Sport > Foot > PSG'
  
$cat_path_arr = udm_cat_path($udm_agent, $cat);
  
$cat_path = '';
  for (
$i=0; $i<count($cat_path_arr); $i+=2) {
    
$path = $cat_path_arr[$i];
    
$name = $cat_path_arr[$i+1];
    
$cat_path .= " > <a href=\"$_SERVER[PHP_SELF]?cat=$path\">$name</a> ";
  }
?>

Voir aussi udm_cat_list().


    Annonces       
 

 Retour au chapitre Php

 

Top
 

Ajouter JungleKey.fr à votre Explorateur

 
 

About Us | © 2007 JungleKey




iBlack | Mobile | Wiki | Ajouter ce moteur
.