php - Which Mobile Browser User Agent string starts with HTTP? -



php - Which Mobile Browser User Agent string starts with HTTP? -

disclaimer: don't want discuss if it's or bad utilize user agent sniffing observe mobile browsers!

there's adopted regex (regular expression) observe mobile browser user agent string can download from site this.

and contains grouping /ht(c(\-| |_|a|g|p|s|t)|tp)/i matching string starting "http".

thus bot or service using php pear module http_request2 using string htp_request2/2.1.1 (http://pear.php.net/package/http_request2) php/5.3.2-1ubuntu4.15 detected mobile browser , redirected websites mobile url.

question: mobile browser detected way? user agent string of mobile browser like? (bonus: needs changed not match http_request2 mobile browser?)

looks matches http://www.voxtel.ru/uaprof/voxtel_*.xml reason, , see start http. can see them in useragents.txt file site. there many others contain http or http later in string though.

you alter pattern, wouldn't rely on http somewhere in user-agent string determine if it's mobile device:

/ht(c(-| |_|a|g|p|s|t))/i

php regex mobile browser user-agent

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -