文章分类 -  递归函数

摘要:/* * 递归实现 * 反向获得节点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 阅读全文
posted @ 2011-04-01 14:37 longbaobao 阅读(316) 评论(0) 推荐(0)
摘要:View Code function static_function () { static $i = 0; if ($i++ < 10) { echo $i . "\n"; static_function(); } 阅读全文
posted @ 2011-03-31 09:49 longbaobao 阅读(182) 评论(0) 推荐(0)