擷取子class_id集合的函數_PHP教程

來源:互聯網
上載者:User
function get_bottom_class_id($class_id){if(!isset($class_id) || !is_numeric($class_id)){return false;}global $db;static $class_id_array=array();$sql="select `class_id` from `".TB_PREFIX."web_class` where `class_parent_id`='".$class_id."'";$rows=$db->getRowsArray($sql,MYSQL_NUM);if(!empty($rows) && is_array($rows)){foreach($rows as $row){get_bottom_class_id($row[0]);}}else{$class_id_array[]=$class_id;}if(is_array($class_id_array)){$class_id=implode(',',$class_id_array);}else{$class_id=$class_id_array;}return $class_id;}

 

您可能感興趣的文章

  • php提取社會安全號碼碼中的生日日期以及驗證是否為未成年人的函數
  • XDebug的進度條停在57%,提示waiting for XDebug session錯誤的解決辦法
  • php中數組的並集、交集和差集合函式介紹
  • php最精確的字串長度截取函數
  • Fatal error Class 'SoapClient' not found in ...錯誤處理辦法
  • Fatal error Class 'ZipArchive' not found ...... 的解決辦法
  • PHP數字判斷函數
  • Javascript中如何為函數設定預設參數值

http://www.bkjia.com/PHPjc/764198.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/764198.htmlTechArticlefunction get_bottom_class_id($class_id){if(!isset($class_id) || !is_numeric($class_id)){return false;}global $db;static $class_id_array=array();$sql="select `class_id` from `".TB_P...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.