- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
$massiv = array(1,2,3,4,5,6,7,8);
$her = 0;
$idRazdelov = array();
$idRoditela = $idrazdelf;
foreach($massiv as $chislo){
$db_list = CIBlockSection::GetList(Array(SORT=>"ASC"), $arFilter = Array("IBLOCK_ID"=>"7", "ID"=>$idRoditela), true);
while($ar_result = $db_list->GetNext()){
if ($her == 0){
if ($ar_result["IBLOCK_SECTION_ID"]){
$idRazdelov[].= $ar_result["ID"];
$idRoditela = $ar_result["IBLOCK_SECTION_ID"];
}else{
$idRazdelov[].= $ar_result["ID"];
$her = 1;
}
}
}
}