I am trying to count the number of elements in the array other than null and compare this number with the number 5. Below is the code
<? $arSelect = Array("ID", "IBLOCK_ID", "NAME", "PROPERTY_DATE_VISIT"); $arFilter = Array("IBLOCK_ID" => "14", "ACTIVE" => "Y", "?PROPERTY_DATE_VISIT" => "04.2018"); $res = CIBlockElement::GetList(Array(), $arFilter, false, Array("nPageSize" => 300), $arSelect); while ($ob = $res->Fetch()) { $result[] = $ob['ID']; } //echo var_dump($result); $value = array(); $peremen = array(); foreach ($result as $value) { $model = new evraz3; $data = $model->loadRestorePass2(1, $value); $firstname = $data["PROPERTY"]["VISITOR"][0]["UF_FIRSTNAME"]; var_dump($firstname); } 