PHP input validation for filtering and validating arrays, form data, JSON, etc