Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 46



Учебник РНР
НазадВперёд

udm_cat_path

(PHP 4 >= 4.0.6)

udm_cat_path - получает путь к текущей категории.

Описание

array udm_cat_path (int agent, string category)

udm_cat_path() возвращает массив с описанием пути/path в дереве категорий от корня до текущей категории.

agent - ссылка на идентификатор агента.

category - текущая категория - та, к которой получаем путь.

Возвращает массив в формате:

Массив состоит из пар. Элементы с чётными номерами содержат путь к категориям, нечётные - имена соответствующих категорий.

Например, вызов $array=udm_cat_path($agent, '02031D'); может возвратить следующий массив:

 $array[0] будет содержать ''
 $array[1] будет содержать 'Root'
 $array[2] будет содержать '02'
 $array[3] будет содержать 'Sport'
 $array[4] будет содержать '0203'
 $array[5] будет содержать 'Auto'
 $array[4] будет содержать '02031D'
 $array[5] будет содержать '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=\"$PHP_SELF?cat=$path\">$name</a> ";
  }
?>

Назад Оглавление Вперёд
udm_cat_list Вверхudm_check_charset


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 155

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 155

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 281

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/udm-cat-path.html on line 281