Just provide $availableLanguages as an array('en', 'de', 'es')
http://snipplr.com/view/12631/detect-browser-language/php-detect-browser-language