Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: udm_cat_path - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net

search for in the

udm_check_charset" width="11" height="7"/> <udm_cat_list
Last updated: Wed, 01 Nov 2006
view this page in

udm_cat_path

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

udm_cat_path -- カレントのカテゴリへのパスを取得する

説明

array udm_cat_path ( resource agent, string category )

ツリーのルートから category が指す現在の カテゴリまでのパスを記述した配列を返します。 agent は、事前の >udm_alloc_agent() のコールにより返された エージェント ID です。

返される配列は、組で構成されています。偶数添字番号の要素にはカテゴリパス、 奇数要素には、対応するカテゴリ名が含まれます。

たとえば、$array=udm_cat_path($agent, '02031D'); をコールすると以下のような配列を返します。
$array[0] will contain ''
 $array[1] will contain 'Root'
 $array[2] will contain '02'
 $array[3] will contain 'Sport'
 $array[4] will contain '0203'
 $array[5] will contain 'Auto'
 $array[4] will contain '02031D'
 $array[5] will contain 'Ferrari'

例 1. 現在のカテゴリへのパスは以下の形式で指定します。 '> Root > Sport > Auto > Ferrari'

<?php
  $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> ";
  }
?>

udm_cat_list() も参照ください。



add a note add a note User Contributed Notes
udm_cat_path
There are no user contributed notes for this page.

udm_check_charset" width="11" height="7"/> <udm_cat_list
Last updated: Wed, 01 Nov 2006
 
 
show source | credits | sitemap | contact | advertising | mirror sites