ibnclaudius Posted June 28, 2012 Share Posted June 28, 2012 Is there a better way to do this? $i = 0; foreach ($posts as $post) { $posts[$i]['function_return'] = function($post['function_param']); $i++; } Link to comment https://forums.phpfreaks.com/topic/264921-apply-a-function-to-every-member-of-an-array/ Share on other sites More sharing options...
Barand Posted June 28, 2012 Share Posted June 28, 2012 foreach ($posts as $i => $post) { $posts[$i]['function_return'] = function($post['function_param']); } Link to comment https://forums.phpfreaks.com/topic/264921-apply-a-function-to-every-member-of-an-array/#findComment-1357646 Share on other sites More sharing options...
ibnclaudius Posted June 28, 2012 Author Share Posted June 28, 2012 Thanks! Link to comment https://forums.phpfreaks.com/topic/264921-apply-a-function-to-every-member-of-an-array/#findComment-1357651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.