Guest User

Untitled

a guest
May 21st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. $result = array();
  2. foreach ($bestliker as $key => $value) {
  3. $result_count_liker_id = $key;
  4. $result_count_liker = $value;
  5. if ($result_count_liker > 0) {
  6. foreach ($bestcommentator as $key2 => $value2) {
  7. $result_count_comment_id = $key2;
  8. $result_count_comment = $value2;
  9. if ($result_count_liker_id == $result_count_comment_id ) {
  10. $result= $result_count_liker + $result_count_comment;
  11. var_dump($result);
  12. }
  13. }
  14. }
  15. }
  16.  
  17. $result = array();
  18. $input= array($bestliker,$bestcommentator);
  19.  
  20. array_walk_recursive($input, function($item, $key) use (&$final){
  21. $final[$key] = isset($final[$key]) ? $item + $final[$key] : $item;
  22. });
Add Comment
Please, Sign In to add comment