I have an array object that looks like this and stored in a variable $named_array
Array
(
[results] => Array
(
[0] => Array
(
[date] => 2013-15-6
[position] => 5
[person] => John
)
[1] => Array
(
[date] => 2013-15-6
[position] => 3
[person] => Alex
)
)
)
Another array called $post which is a WordPress post object array called with $posts = get_posts(array(.... I then have a foreach each loop with $post being the variable.
Within my foreach loop i've tried the following to combine the arrays but it's not working.
$combinedData = array_merge($post, $named_array);
print_r($combinedData);
I can see my post object arrays with print_r($post); within the foreach loop as well as the named_array. What's the correct function to add the named_array to the post array?
Thanks