在php中我们要获取浏览器信息可以直接使用$userAgent = strtolower($_SERVER["HTTP_USER_AGENT"]);然后再判断一下就可以判断用户浏览器版本或型号了,希望下面的实例对大家有所帮助.
下面笔者为各位介绍一款如何判断用户浏览器是不是IE6的php函数,如果是返回“真”,否则返回“假”.
实例代码如下:
- function isIE6() {
- $userAgent = strtolower($_SERVER["HTTP_USER_AGENT"]);
- //从HTTP_USER_AGENT字段中获取用户浏览器信息
- if (ereg("msie 6", $userAgent) || ereg("msie 5", $userAgent)) {
- return true;
- }
- return false;
- }
完整点的实例代码如下:
- function userBrowser(){
- $user_OSagent = $_SERVER['HTTP_USER_AGENT'];
- if(strpos($user_OSagent,"Maxthon") && strpos($user_OSagent,"MSIE")) {
- $visitor_browser ="Maxthon(Microsoft IE)";
- }elseif(strpos($user_OSagent,"Maxthon 2.0")) {
- $visitor_browser ="Maxthon 2.0";
- }elseif(strpos($user_OSagent,"Maxthon")) {
- $visitor_browser ="Maxthon";
- }elseif(strpos($user_OSagent,"MSIE 9.0")) {
- $visitor_browser ="MSIE 9.0";
- }elseif(strpos($user_OSagent,"MSIE 8.0")) {
- $visitor_browser ="MSIE 8.0";
- }elseif(strpos($user_OSagent,"MSIE 7.0")) {
- $visitor_browser ="MSIE 7.0";
- }elseif(strpos($user_OSagent,"MSIE 6.0")) {
- $visitor_browser ="MSIE 6.0";
- } elseif(strpos($user_OSagent,"MSIE 5.5")) {
- $visitor_browser ="MSIE 5.5";
- } elseif(strpos($user_OSagent,"MSIE 5.0")) {
- $visitor_browser ="MSIE 5.0";
- } elseif(strpos($user_OSagent,"MSIE 4.01")) {
- $visitor_browser ="MSIE 4.01";
- }elseif(strpos($user_OSagent,"MSIE")) {
- $visitor_browser ="MSIE 较高版本";
- }elseif(strpos($user_OSagent,"NetCaptor")) {
- $visitor_browser ="NetCaptor";
- } elseif(strpos($user_OSagent,"Netscape")) {
- $visitor_browser ="Netscape";
- }elseif(strpos($user_OSagent,"Chrome")) {
- $visitor_browser ="Chrome";
- } elseif(strpos($user_OSagent,"Lynx")) {
- $visitor_browser ="Lynx";
- } elseif(strpos($user_OSagent,"Opera")) {
- $visitor_browser ="Opera";
- } elseif(strpos($user_OSagent,"Konqueror")) {
- $visitor_browser ="Konqueror";
- } elseif(strpos($user_OSagent,"Mozilla/5.0")) {
- $visitor_browser ="Mozilla";
- } elseif(strpos($user_OSagent,"Firefox")) {
- $visitor_browser ="Firefox";
- }elseif(strpos($user_OSagent,"U")) {
- $visitor_browser ="Firefox";
- } else {
- $visitor_browser ="其它";
- }
- return $visitor_browser;
- }
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php获取IE浏览器版本函数
波比源码 » php获取IE浏览器版本函数
buy levofloxacin 500mg without prescription buy levaquin online cheap
purchase dutasteride online avodart generic ondansetron 8mg without prescription
buy aldactone 25mg pills cheap finasteride 5mg order fluconazole 100mg without prescription
ampicillin 250mg pill cephalexin for sale online buy erythromycin 500mg pills
sildenafil brand robaxin 500mg for sale methocarbamol for sale
sildenafil pills aurogra 50mg drug purchase estrace online
lamotrigine 200mg ca mebendazole medication retin cream sale
isotretinoin 20mg drug buy azithromycin generic buy azithromycin 500mg online cheap
buy indomethacin online lamisil over the counter amoxicillin pills
order cialis perscription drugs from canada real viagra pills
cialis 10mg pas cher sildenafil 100mg sans ordonnance en france acheter 50mg du viagra
order prednisone 20mg generic over the counter generic cialis sildenafil 100mg cost
tadalafil 20mg generika sildenafil 200mg kaufen ohne rezept viagra 200mg kaufen generika
accutane pills amoxil for sale buy ivermectin cream
ramipril for sale online order altace 10mg online cheap purchase astelin online
order buspar without prescription amiodarone 100mg us order generic oxybutynin
buy prograf generic order tacrolimus 5mg generic brand urso
isosorbide usa lanoxin 250 mg drug telmisartan 80mg usa
order zoloft 50mg for sale buy kamagra 200mg without prescription viagra without prescription
buy naltrexone 50mg without prescription letrozole 2.5mg cheap buy abilify 30mg generic
order provera 10mg online order microzide 25mg sale cyproheptadine 4 mg oral
luvox pills order fluvoxamine 50mg generic glucotrol ca
accutane 10mg brand order accutane 10mg without prescription oral prednisone
nootropil 800 mg usa sildenafil viagra buy viagra 50mg for sale
buy tadalafil 5mg without prescription order cialis 40mg without prescription viagra pills 150mg
lasix 40mg pills buy plaquenil 400mg pills plaquenil 400mg price
order tadalafil 20mg without prescription cheap betamethasone 20 gm anafranil generic
buy aralen pill chloroquine 250mg generic buy baricitinib 4mg generic
buy itraconazole without prescription prometrium 200mg uk buy tindamax generic
cost glucophage 1000mg cialis 10mg price cialis brand
order olanzapine 10mg sale order olanzapine 10mg generic buy diovan pill
buy norvasc 10mg tadalafil 5mg cost tadalafil 20mg brand
order clozapine 50mg generic order ipratropium 100 mcg pills order decadron 0,5 mg without prescription
buy viagra 100mg for sale buy sildenafil 100mg online cheap lisinopril 10mg brand
buy lopressor 100mg sale tenormin pills purchase vardenafil for sale
write my paper gambling games casino arizona
term paper service how to write an essay about my life cheap sildenafil
buy aristocort without prescription order loratadine 10mg sale buy clarinex 5mg generic
xenical for sale online diltiazem oral zovirax 800mg oral
methotrexate 2.5mg over the counter buy metoclopramide 10mg without prescription buy reglan 20mg for sale
purchase ozobax for sale toradol over the counter toradol 10mg uk
imitrex pill buy imitrex 25mg for sale buy generic avodart
brand gloperba best real casino online casino slot games
buy ranitidine 150mg pills zantac us order celecoxib pill
casino play free games poker online online blackjack spins website
order flomax generic oral flomax 0.4mg spironolactone 100mg sale
tadalafil 5mg ca purchase ampicillin generic cipro for sale online
diflucan 200mg usa fluconazole buy online buy viagra sale
tadalafil 10mg for sale viagra 50mg pill order sildenafil 100mg sale