早教吧 育儿知识 作业答案 考试题库 百科 知识分享

php递归我该怎么返回一个字符串functionchildren($categorylist,$aaa){foreach($categorylistas$v){if($v['children']){$aaa['list']=$v[id];children($v['children'],$aaa);}}return$aaa;}$b=children($categorylist,$aaa);

题目详情
php 递归 我该怎么返回一个字符串
function children($category_list,$aaa) {
foreach($category_list as $v) {
if($v['children']) {
$aaa['list']=$v[id];
children($v['children'],$aaa);
}
}
return $aaa;
}
$b=children($category_list,$aaa);
▼优质解答
答案和解析
$b就是最终的返回值