Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1.     $samePoints = array();
  2.     for ($a = 0; $a < count($lestvica); $a++) {
  3.          for ($b = $a + 1; $b < count($lestvica); $b++) {
  4.              if($lestvica[$a]->tocke == $lestvica[$b]->tocke) {
  5.                  $points = $lestvica[$a]->tocke;
  6.                  if(!isset($samePoints[$points])) {
  7.                      $samePoints[$points] = [];
  8.                  }
  9.                  if(!in_array($samePoints[$points], $lestvica[$a]->ekipa_id)) {
  10.                      array_push($samePoints[$points], $lestvica[$a]->ekipa_id);
  11.                  }
  12.                  if(!in_array($samePoints[$points], $lestvica[$b]->ekipa_id)) {
  13.                      array_push($samePoints[$points], $lestvica[$b]->ekipa_id);
  14.                  }
  15.               }      
  16.           }
  17.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement