文章分类 - 递归函数
摘要:/* * 递归实现 * 反向获得节点id的父节点 * $id interger 不可以为0 * return array 其父节点数组 */function getNodeLever($id){ $parents=array(); if (array_key_exists($this->cateArray[$id],$this->cateArray))//它的父节点,在节点树中 { $parents[]=$this->cateArray[$id]; $parents=array_merge($parents,$this->getNodeLever($this->c
阅读全文
摘要:View Code function static_function () { static $i = 0; if ($i++ < 10) { echo $i . "\n"; static_function(); }
阅读全文

浙公网安备 33010602011771号