Sure, here is the function:


```php
/**
 * Returns the language of the user calling the page
 *
 * @return	$lang		Language of the user if in a white list (default "en")
 *
 * @ref	https://stackoverflow.com/questions/3770513/detect-browser-language-in-php
 */
function get_requestor_preferred_language() {
    $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
    $acceptLang = ["es", "de", "en", "fr", "zh", "jp"];
    $lang = in_array($lang, $acceptLang) ? $lang : "en";
    return $lang;
}
```
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence