Код: Выделить всё
$arr =
[
[
'slug' => 'products-services-pricing',
'text' => 'Products/Services and Pricing',
],
[
'slug' => 'promotions-plan',
'text' => 'Promotions Plan',
],
(1 == 2) ?
[
'slug' => 'distribution-plan',
'text' => 'Distribution Plan',
] : null,
];
echo "Count = ".count($arr)."\n";
print_r($arr);
Я не могу выполнить проверку условий в foreach, потому что использую count.
Подробнее здесь: https://stackoverflow.com/questions/744 ... ay-element
Мобильная версия