Data type validation helper for use with PHP.