As per your requirement "each value can only be there for once" if you are just interested in keeping unique values in your array, then the array_unique()
might be what you are looking for.
Input:
$input = array(4, "4", "3", 4, 3, "3");
$result = array_unique($input);
var_dump($result);
Result:
array(2) {
[0] => int(4)
[2] => string(1) "3"
}