I have this code chunk
$data['cp'][$key]->prominence = $meta_data['prominence'];
$data['cp'][$key]->related_link = (function()
{ $arr = array();
for ( $i = 1; $i < 4 ; $i++ ) {
$rldata = array();
$rldata['title'] = $metadata['related_link_'.$i.'_title'];
$rldata['title'] = $metadata['related_link_'.$i.'_url'];
array_push( $arr, $rldata );
}
return $arr;
});
As you can see, I want $data['cp'][$key]->related_link to be equal to a multidimensional array dynamically generated by the anonymous function.
However when using print_r it just shows the key as being equal to a Closure. How do I edit the code so it actually returns the array, rather than just being equal to a closure.