So I have the following array:
array:3 [
0 => "6.05"
1 => "5.94"
2 => "5.96"
]
Which is passed through the following function:
$filteredShots = array_filter($shots, function($shot) {
if (is_numeric($shot)) {
return floatval($shot);
}
});
Which then spits out, the exact same array:
array:3 [
0 => "6.05"
1 => "5.94"
2 => "5.96"
]
Why are these still strings? I told it to convert them to floatval. Am I doing something wrong? Am I crazy?
If I die and dump on the return statement I get: 6.05, not "6.05" so ... why is the array reflecting that?