fork download
  1. <?php
  2.  
  3. $input = '1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,15,33,33,35,37,39';
  4. $inputArray = explode(',', $input);
  5. $counted = array_count_values($inputArray);
  6.  
  7. foreach ( $counted as $k=>$v ) {
  8. if ( $v > 1 ) {
  9. echo "{$k} се повтаря {$v} пъти!<br>";
  10. }
  11. }
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
15 се повтаря 2 пъти!<br>33 се повтаря 2 пъти!<br>