Array to string conversion on array_map
I'm using array_map to sort out an array with all of my _octopud_id's.
var_dump($offices)
: Returns the following:
array (size=500)
0 =
array (size=1)
'id' = string '1382' (length=4)
1 =
array (size=1)
'id' = string '1330' (length=4)
I need to input that array integer into the 'employees/' section but I can't figure out how - If I hardcode employees/6
I get the following result:
object(stdClass)[14592]
public 'id' = int 6
What could I be doing wrong? I keep getting the Notice: Array to string conversion
error on the $results = line.
/* Return an array of _octopus_ids */
$offices = array_map(
function($post) {
return array(
'id' = get_post_meta($post-ID, '_octopus_id', true),
);
},
$query-posts
);
var_dump($offices);
$results = $octopus-get_all('employee/' . implode($offices));
var_dump($results);