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.