Home >Backend Development >PHP Tutorial >Commercial bank loan classification PHP recursive implementation of infinite classification function to generate drop-down list

Commercial bank loan classification PHP recursive implementation of infinite classification function to generate drop-down list

WBOY
WBOYOriginal
2016-07-29 08:43:33952browse

Copy the code The code is as follows:


/*—————————————————————— */
//– Recursively implement infinite classification generation drop-down list function
// – $tpl->assign('sort_list',createSortOptions ());
//– $tpl->assign('sort_list',createSortOptions ($sort_id));
/*———————— —————————— */
function createSortOptions ($selected=0,$parent_id=0,$n=-1)
{
global $db;
$sql = "SELECT * FROM `@__article_sort ` WHERE `parent_id` = '{$parent_id}'";
$options = ";
static $i = 0;
if ($i == 0)
{
$options .= '

The above introduces the function of commercial bank loan classification using PHP to recursively realize unlimited classification and generate a drop-down list, including the content of commercial bank loan classification. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn