I thought to share with you the code that detects real user agent 8) Demo: www.tinytop.mobi
www.inbuzunar.mobi -Your mobile portal pocket
Started on the old forum in February 2012 · view the original in the archive · old links redirect here
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
I thought to share with you the code that detects real user agent 8) Demo: www.tinytop.mobi
www.inbuzunar.mobi -Your mobile portal pocket
i just edited user agent in firefox to nokia 600 but its detect nokia 600 not mozilla firefox agent then how it detecting real user agent?
It works with me after I changed my browser identification on my blackberry to to mozilla ?????
FAKE: Mozilla/5.0 (BlackBerry; U; BlackBerry 9780; en) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.546 Mobile Safari/534.8+ (code update - 02.02.2012, 02.02 Ro)
REAL: BlackBerry 9780
My site: http://mimobifunclub.tk
It's Mine. Just a few code.
function getoribrowser($_mob_browser){
if(preg_match('/(google|bot)/i',strtolower($_mob_browser))){
$position = strpos(strtolower($_mob_browser),"bot");
$_mob_browser = substr($_mob_browser, $position-30, $position+2);
$_browser = explode (" ", $_mob_browser);
$_browser = array_reverse($_browser);
}else if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])) {
$_mob_browser = $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}else {
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}
return $_browser[0];
}
Visit my WEBSITE Project: http://www.aspirewap.net
Code update or visit site 🙂
www.inbuzunar.mobi -Your mobile portal pocket
Why "Nokia/" with slash
Ohhh, why you post offtopic? Don't ask why the code it write in some way, download & use it..if you know how 😀
www.inbuzunar.mobi -Your mobile portal pocket
Final update with major changes, enjoy the best user agent detector 🙂 http://www.tinytop.mobi
www.inbuzunar.mobi -Your mobile portal pocket
Should be more. 🙂
For example, no need suppressing ;-_ and so when only needs delimiters and quantifiers suppressed, which are:
\ | ( ) [ { ^ $ * + ? . < >
Note where are only left brackets.
\s you should change, it is not only white space, it is line brakes and tabs also. You probably know what happens with php in the new line. 😉 Replace it with:
\p{Zs}
This is only white space. 🙂
Thank you arnage, next week i'll make a test with your ideas, till now check new update 🙂
www.inbuzunar.mobi -Your mobile portal pocket
hey kiss nice script you may want to think about using an array and using a for/while loop as 95% of your script is returning $match[0] so it would reduce the amount of hard coding and make it run faster