Monkuar Posted December 15, 2011 Share Posted December 15, 2011 Hey, I am echoing out: $source = implode(',', $arr2); echo $source; which is a array, and it echo's out: "2,2,2" I am trying to find a php function to add each array, so the result will be "6". Possible? Quote Link to comment https://forums.phpfreaks.com/topic/253270-adding-a-implode-value-into-1-integer/ Share on other sites More sharing options...
Monkuar Posted December 15, 2011 Author Share Posted December 15, 2011 WOW count function i am a idiot, Topic resolved ty Quote Link to comment https://forums.phpfreaks.com/topic/253270-adding-a-implode-value-into-1-integer/#findComment-1298326 Share on other sites More sharing options...
MasterACE14 Posted December 15, 2011 Share Posted December 15, 2011 array_sum() echo array_sum($source); // 6 Quote Link to comment https://forums.phpfreaks.com/topic/253270-adding-a-implode-value-into-1-integer/#findComment-1298327 Share on other sites More sharing options...
scootstah Posted December 15, 2011 Share Posted December 15, 2011 WOW count function i am a idiot, Topic resolved ty No, count will count the number of elements inside an array. What you want is array_sum() like MasterACE14 said. Quote Link to comment https://forums.phpfreaks.com/topic/253270-adding-a-implode-value-into-1-integer/#findComment-1298329 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.