puoi usare le funzioni

is_numeric

is_string