<HTML ><HEAD ><TITLE >udm_cat_list</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Manual de PHP" HREF="index.html"><LINK REL="UP" TITLE="mnoGoSearch Functions" HREF="ref.mnogo.html"><LINK REL="PREVIOUS" TITLE="udm_api_version" HREF="function.udm-api-version.html"><LINK REL="NEXT" TITLE="udm_cat_path" HREF="function.udm-cat-path.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual de PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.udm-api-version.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.udm-cat-path.html" ACCESSKEY="N" >Siguiente</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.udm-cat-list" ></A >udm_cat_list</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN46035" ></A ><P > (PHP 4 >= 4.0.6)</P >udm_cat_list -- Get all the categories on the same level with the current one.</DIV ><DIV CLASS="refsect1" ><A NAME="AEN46038" ></A ><H2 >Description</H2 >array <B CLASS="methodname" >udm_cat_list</B > ( int agent, string category)<BR ></BR ><P > <B CLASS="function" >udm_cat_list()</B > returns array listing all categories of the same level as current category in the categories tree. </P ><P > The function can be useful for developing categories tree browser. </P ><P > Returns array with the following format: </P ><P > The array consists of pairs. Elements with even index numbers contain category paths, odd elements contain corresponding category names. </P ><P CLASS="literallayout" ><br> <br> $array[0] will contain '020300'<br> $array[1] will contain 'Audi'<br> $array[2] will contain '020301'<br> $array[3] will contain 'BMW'<br> $array[4] will contain '020302'<br> $array[5] will contain 'Opel'<br> ...<br> etc.<br> <br> </P ><P CLASS="literallayout" ><br> Following is an example of displaying links of the current level in format:<br> Audi<br> BMW<br> Opel<br> ...<br> </P ><DIV CLASS="informalexample" ><A NAME="AEN46056" ></A ><P ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?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=\"$PHP_SELF?cat=$path\">$name</a><br>"; } ?></PRE ></TD ></TR ></TABLE ><P ></P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.udm-api-version.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Inicio</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.udm-cat-path.html" ACCESSKEY="N" >Siguiente</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >udm_api_version</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.mnogo.html" ACCESSKEY="U" >Subir</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >udm_cat_path</TD ></TR ></TABLE ></DIV ></BODY ></HTML >