В современных приложениях отдается предпочтение Юникоду (UTF-8). На 1 апреля 2019 лишь на 1 % всех веб-страниц используется Windows-1251.
$name = 'название';
$arSelect = Array("*");
$arFilter = Array("IBLOCK_ID"=>IntVal($yvalue), "NAME"=>$name);
$res = CIBlockElement::GetList(Array(), $arFilter, false, Array(), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}
foreach ($objWorksheet as $index => $item) {
foreach ($item as $key => $val) {
if ($val === null){
$objWorksheet[$index][$key] = 0;
}
}
}
<?php
function walk_recursive_remove (array $array, callable $callback) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = walk_recursive_remove($v, $callback);
} else {
if ($callback($v, $k)) {
unset($array[$k]);
}
}
}
return $array;
}
$array = [[
"" => "что то не нужное",
"brand" => "Бренд",
"code" => "Артикул",
"price" => "цена",
"quantity" => "кол-во",
"name" => "нейм"
]];
$filtered = walk_recursive_remove($array, function ($value, $key) {
return empty($value) || empty($key);
});
var_dump($filtered);
$keys = ['code', 'name', 'count'];
foreach ($array as $index => $item) {
$array[$index] = array_combine($keys, $item);
}
<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<h5 class="mb-0">
<button class="btn btn-link">
Collapsible Group Item #1
</button>
</h5>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt
aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat
craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
</div>
</div>