I have a php array with strings and I'd like to delete the keys that have a string containing only numbers.
How can I do that?
Filtering the array would be the most elegant way:
$array = array_filter($array, 'is_numeric');
This returns an array with only those values for whom is_numeric() is true.
is_int.foreach ($array as $key => $val)
if (is_numeric($key)) // only numbers, a point and an `e` like in 1.1e10
unset($array[$key]);
This unsets all the entries where there are only numbers.