I have an array of values and I’d like to check that all values are either string or numeric. What is the most efficient way to do this?
Currently I’m just checking for strings so I was just doing if (array_filter($arr, 'is_string') === $arr) which seems to be working.
See: PHP’s is_string() and is_numeric() functions.
Combined with
array_filter, you can then compare the two arrays to see if they are equal.