I have this array:
Array
(
[boks_1] => Array
(
[tittel] => Test
[innhold] => This is a test text
[publish] => 2
)
[boks_2] => Array
(
[tittel] => Test 3
[innhold] => This is a text test
[publish] => 1
)
[boks_3] => Array
(
[tittel] => Kontakt oss
[innhold] => This is a test text
[publish] => 1
)
)
How can I use PHP count() to count how many times [publish] => 1 appears in my array? I am going to use the value to control the width of divs in a flexbox container.
count()function, you will need to loop through the array and increment a counter.