Would you like to react to this message? Create an account in a few clicks or log in to continue.

Kodi nė PHP pėr tė zbuluar shfletuesin e Internetit

Go down

Kodi nė PHP pėr tė zbuluar shfletuesin e Internetit Empty Kodi nė PHP pėr tė zbuluar shfletuesin e Internetit

Post by Naki Fri 27 Sep 2013, 14:47

Kėtė kod mund ta pėrdorni pėr tė zbulluar ēfarė shfletuesi ėshtė duke pėrdor vizitori faqes tuaj. Ky kodė mund gjej nėse shfletuesi ėshtė Internet Explorer (IE), Firefox, Opera ose Safari.
Code:
<?php
$useragent = $_SERVER[˜HTTP_USER_AGENT']);

if (preg_match(˜|MSIE ([0-9].[0-9]{1,2})|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = ˜IE';
} elseif (preg_match( ˜|Opera ([0-9].[0-9]{1,2})|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = ˜Opera';
} elseif(preg_match(˜|Firefox/([0-9\.]+)|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = ˜Firefox';
} elseif(preg_match(˜|Safari/([0-9\.]+)|',$useragent,$matched)) {
$browser_version=$matched[1];
$browser = ˜Safari';
} else {
// browser not recognized!
$browser_version = 0;
$browser= other';
}

print "Shfletuesi: $browser $browser_version;
Naki
Naki

Shteti : Republika e Kosovės
Postime : 9124
Kyējet nė forum : 26212
Regjistruar mė : 2007-05-29

https://naki.albanianforum.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum