php - How to validate HTTP_ACCEPT_LANGUAGE? -



php - How to validate HTTP_ACCEPT_LANGUAGE? -

since script gets $_server['http_accept_language'] visitor anything. how can validate it? acceptable?

to first language within string use:

substr($_server["http_accept_language"],0,2)

for example

$user_lang= split(",",$_server["http_accept_language"]); $language = $user_lang[0]; // header injection. if(stripos($language, 'content-type') !== false ) { exit; }

php

Comments

Popular posts from this blog

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -