Question: How do I create a function to check if a number is inside an array a certain times and returns `true`. I tried to use `array_exist` but it only check if a number exist and there is no param for how many of them exist. Is there a built in function for this? 

I appreciate it if someone can point me to the right direction. I been thinking about it and cant seem to figure out.

Answer: 
If I understood correctly, you can use this (straight from the [PHP manual](http://php.net/manual/en/function.array-count-values.php)):

```
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));

```

outputs

```
Array
(
    [1] => 2
    [hello] => 2
    [world] => 1
)

```

You can easily make a function you need out of this
Use array\_count\_values()

Example

```
$array = array(1,2,1,3,1);
$array2 = array(0,1,2,3,1);

echo (array_count_values($array)[1]==3 ? 'OK' : 'NO').'<br>';
echo array_count_values($array2)[1]==3 ? 'OK' : 'NO';

```

[DEMO VIEW](http://codepad.viper-7.com/IjtejP)