I have an array, which contains data as follows:
Array (
[google.com] => Array
(
[youseo.com] => 1,
[seo.com] => 1,
[linkbuilding.com] => 0,
[seo556.com] => 1,
)
[youtube.com] => Array
(
[youseo.com] => 0,
[seo.com] => 0,
[linkbuilding.com] => 0,
[seo556.com] => 1,
)
[facebook.com] => Array
(
[youseo.com] => 0,
[seo.com] => 1,
[linkbuilding.com] => 1,
[seo556.com] => 0,
)
)
And I need to populate new array and count value of url:
Array
(
[google.com] => 3
[youtube.com] => 1
[facebook.com] => 2
)
Please any help for this?
You could use
array_valuesandarray_sum:But that’s assuming the values can only be 0 or 1.