Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function contar($array)
- {
- $repetidos = 0;
- $ya_duplicados = array();
- foreach($array as $item)
- {
- for($u=0;$u<sizeof($array); $u++)
- {
- if($item == $array[$u] && !in_array($item, $ya_duplicados))
- {
- ++$cont;
- }
- }
- if($cont >= 2)
- {
- array_push($ya_duplicados, $item);
- $repetidos++;
- }
- $cont = 0;
- }
- return $repetidos;
- }
Add Comment
Please, Sign In to add comment