⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.udm-cat-list.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Get all the categories on the same level with the current one</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.udm-api-version.html">udm_api_version</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.udm-cat-path.html">udm_cat_path</a></div> <div class="up"><a href="ref.mnogosearch.html">mnoGoSearch Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.udm-cat-list" class="refentry"> <div class="refnamediv">  <h1 class="refname">udm_cat_list</h1>  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5 &lt;= 5.0.5, PECL mnogosearch:1.0.0)</p><p class="refpurpose"><span class="refname">udm_cat_list</span> &mdash; <span class="dc-title">Get all the categories on the same level with the current one</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>udm_cat_list</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$agent</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$category</tt></span>   )</div>  <p class="para rdfs-comment">   Gets all the categories on the same level with the current one.  </p>  <p class="para">   The function can be useful for developing categories tree browser.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">agent</tt></i></span>     <dd>      <p class="para">       A link to Agent, received after call to       <a href="function.udm-alloc-agent.html" class="function">udm_alloc_agent()</a>.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">category</tt></i></span>     <dd>      <p class="para">      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns an array listing all categories of the same level as the current   <i><tt class="parameter">category</tt></i> in the categories tree.  </p>  <p class="para">   The returned array consists of pairs. Elements with even index numbers   contain the category paths, odd elements contain the corresponding category   names.  </p>  <div class="example-contents"><pre><div class="cdata"><pre>  $array[0] will contain &#039;020300&#039;  $array[1] will contain &#039;Audi&#039;  $array[2] will contain &#039;020301&#039;  $array[3] will contain &#039;BMW&#039;  $array[4] will contain &#039;020302&#039;  $array[5] will contain &#039;Opel&#039;  ... etc.</pre></div>  </pre></div> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   Following is an example of displaying links of the current level in format:   <div class="example-contents"><pre><div class="cdata"><pre>  Audi  BMW  Opel  ...</pre></div>   </pre></div>   <div class="example">    <p><b>Example #1 <b>udm_cat_list()</b>example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;$cat_list_arr&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">udm_cat_list</span><span style="color: #007700">(</span><span style="color: #0000BB">$udm_agent</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$cat</span><span style="color: #007700">);<br />&nbsp;</span><span style="color: #0000BB">$cat_list&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br />&nbsp;for&nbsp;(</span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$cat_list_arr</span><span style="color: #007700">);&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">+=</span><span style="color: #0000BB">2</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$path&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$cat_list_arr</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$cat_list_arr</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cat_list&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">"&lt;a&nbsp;href=\"$_SERVER[PHP_SELF]?cat=$path\"&gt;$name&lt;/a&gt;&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.udm-cat-path.html" class="function" rel="rdfs-seeAlso">udm_cat_path()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.udm-api-version.html">udm_api_version</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.udm-cat-path.html">udm_cat_path</a></div> <div class="up"><a href="ref.mnogosearch.html">mnoGoSearch Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -