Array
(
[0] => Array
(
[0] => "Product Category"
[1] => Product Name
[2] => Product ID
[3] => Average Item Price
[4] => Item Sales
[5] => Items Sold
[6] => Product Conversion (Sold/Views)
[7] => Item Abandonment Rate
)
[1] => Array
(
[0] => OVERALL
[1] => -
[2] => -
[3] => $51.17
[4] => $1335974.77
[5] => 26111
[6] => 16.25%
[7] => 42.06%
)
ARRAY B:
Array
(
[0] => Array
(
[0] => "Content Category"
[1] => Page Name
[2] => Page Views
[3] => Sessions
[4] => Orders / Session
[5] => Sales
[6] => Bounce Rate
[7] => Page Views / Session
)
[1] => Array
(
[0] => OVERALL
[1] => -
[2] => 1017924
[3] => 135154
[4] => 16.57%
[5] => $1354866.20
[6] => 23.81%
[7] => 7.53
)
I want to combine two arrays into one… where the result will look like:
Array
(
[0] => Array
(
[0] => "Product Category"
[1] => Product Name
[2] => Product ID
[3] => Average Item Price
[4] => Item Sales
[5] => Items Sold
[6] => Product Conversion (Sold/Views)
[7] => Item Abandonment Rate
[8] => "Content Category"
[9] => Page Name
[10] => Page Views
[11] => Sessions
[12] => Orders / Session
[13] => Sales
[14] => Bounce Rate
[15] => Page Views / Session
)
[1] => Array
(
[0] => OVERALL
[1] => -
[2] => -
[3] => $51.17
[4] => $1335974.77
[5] => 26111
[6] => 16.25%
[7] => 42.06%
[8] => OVERALL
[9] => -
[10] => 1017924
[11] => 135154
[12] => 16.57%
[13] => $1354866.20
[14] => 23.81%
[15] => 7.53
)
I only want to output the matched arrays where the “Product Category” == “Content Category”, and combine the two array elements…
I wasn’t too sure if there was a predefined function for this, but I’m assuming I have to do some sort of array_intersect() or array_merge()… the main point is to grab the matching elements and combine both elements from both arrays into one so I can do some post processing calculations…
Thanks!
I figured out the answer of my question..