PHP100 2019-03-27
代码如下:
//@获取子栏目ID号 private function sonCategoryIds($categoryID) { //@初始化栏目数组 $array[] = $categoryID; do { $ids = ''; $temp = $this->mysql->select('SELECT `id` FROM `pcb_article_category` WHERE `parentID` IN (' . $categoryID . ')'); foreach ($temp as $v) { $array[] = $v['id']; $ids .= ',' . $v['id']; } $ids = substr($ids, 1, strlen($ids)); $categoryID = $ids; } while (!empty($temp)); $ids = implode(',', $array); return $ids; }
alert('请至少选择一项!}); 本源码的功能: 获取name=‘key'的复选框的值,将选中项的 value 写到隐藏域 <input type="hidden" name="ids" id="