udm_cat_list

(PHP 4 >= 4.0.6, PHP 5 < 5.1.0, PECL mnogosearch >= 1.0.0)

udm_cat_listGet all the categories on the same level with the current one

说明

udm_cat_list ( resource $agent , string $category ) : array

Gets all the categories on the same level with the current one.

The function can be useful for developing categories tree browser.

参数

agent

A link to Agent, received after call to udm_alloc_agent().

category

返回值

Returns an array listing all categories of the same level as the current category in the categories tree.

The returned array consists of pairs. Elements with even index numbers contain the category paths, odd elements contain the corresponding category names.

$array[0] will contain '020300'
  $array[1] will contain 'Audi'
  $array[2] will contain '020301'
  $array[3] will contain 'BMW'
  $array[4] will contain '020302'
  $array[5] will contain 'Opel'
  ...
 etc.

范例

Following is an example of displaying links of the current level in format:

Audi
  BMW
  Opel
  ...

Example #1 udm_cat_list()example

<?php
 $cat_list_arr 
udm_cat_list($udm_agent$cat);
 
$cat_list '';
 for (
$i=0$i<count($cat_list_arr); $i+=2) {
    
$path $cat_list_arr[$i];
    
$name $cat_list_arr[$i+1];
    
$cat_list .= "<a href=\"$_SERVER[PHP_SELF]?cat=$path\">$name</a><br />";
 }
?>

参见

相关文章
php apd 函数 return all current regular resources as an arrayphp apd 函数 changes or sets the current debugging levelphp expect 函数 waits until the output from a process matches one of the patterns a specified time period has passed or an eof is seenphp gnupg 函数 removes all keys which were set for encryption beforephp informix 函数 set the default blob mode for all select queriesphp imap 函数 get information about the current mailboxphp kadm5 函数 gets all principals from the kerberos databasephp maxdb 函数 get current field offset of a result pointerphp mysqlnd qc 函数 returns information on the current handler the number of cache entries and cache entries if availablephp ncurses 函数 add string with specified length at current positionphp ncurses 函数 clear screen from current position to end of linephp ncurses 函数 get character and attribute at current positionphp newt 函数 replaces the current help line with the one from the stackphp session 函数 register one or more global variables with the current sessionphp snmp 函数 return all objects including their respective object id within the specified onephp snmp 函数 return all objects including their respective object id within the specified onephp mnogosearch 函数 get all the categories on the same level with the current onephp mnogosearch 函数 get the path to the current categoryphp mnogosearch 函数 clear all mnogosearch search restrictionsphp sam 函数 commits completes the current unit of work
关注编程学问公众号