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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With