[PHP] Détecter le navigateur / bot en fonction du HTTP_USER_AGENT

Discussion dans 'Développement d'un site Web ou d'une appli mobile' créé par mike.php, 12 Janvier 2017.

  1. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    Bonjour à tous chers WRINautes,

    je voulais partager avec vous une fonction PHP qui permet de détecter le navigateur (et pas la version) utilisé par un client en fonction de son HTTP_USER_AGENT..
    peut-être que cela peut vous être utile, elle est très concise..

    Si vous trouvez un bug, dites-le moi ;)

    PHP:
    <span class="syntaxdefault"><br /></span><span class="syntaxkeyword"><?</span><span class="syntaxdefault">php<br />function detect_browser</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">null</span><span class="syntaxkeyword">){<br />if(!</span><span class="syntaxdefault">is_string</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">))</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">$_SERVER</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'HTTP_USER_AGENT'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'#(?:(?P<u1>abr)|(?P<u2>aco)|(?P<u3>america\s)|(?P<u4>amigav)|(?P<u5>aol)|(?P<u6>aror)|(?P<u8>beon)|(?P<u9>bone)|(?P<u10>cami)|(?P<u11>charo)|(?P<u12>ches)|(?P<u13>chim)|(?P<u15>chromep)|(?P<u16>cla)|(?P<u17>comet)|(?P<u18>como)|(?P<u19>conk)|(?P<u20>craz)|(?P<u21>cybe)|(?P<u22>deepn)|(?P<u23>deskb)|(?P<u24>dil)|(?P<u26>edge)|(?P<u27>elem)|(?P<u28>elin)|(?P<u29>enigma\s)|(?P<u30>enigmaf)|(?P<u32>esc)|(?P<u33>fireb)|(?P<u35>firew)|(?P<u36>flo)|(?P<u37>flu)|(?P<u39>gale)|(?P<u40>granp)|(?P<u41>gree)|(?P<u42>hana)|(?P<u43>hotj)|(?P<u44>ibm\s)|(?P<u45>ibrows)|(?P<u46>icab)|(?P<u47>icea)|(?P<u48>icec)|(?P<u49>icew)|(?P<u50>inet)|(?P<u52>iron)|(?P<u53>k-m)|(?P<u54>k-n)|(?P<u55>kaz)|(?P<u56>kk)|(?P<u57>konqu)|(?P<u58>lee)|(?P<u60>lobo)|(?P<u61>lol)|(?P<u62>loren)|(?P<u63>lun)|(?P<u64>lyn)|(?P<u65>madf)|(?P<u67>mido)|(?P<u68>minef)|(?P<u70>myib)|(?P<u72>namo)|(?P<u73>navs)|(?P<u74>ncs)|(?P<u75>netn)|(?P<u76>netp)|(?P<u78>netsu)|(?P<u79>omniw)|(?P<u80>orc)|(?P<u81>oreg)|(?P<u82>osb)|(?P<u83>pale)|(?P<u84>phoe)|(?P<u85>pog)|(?P<u86>prism)|(?P<u87>qt)|(?P<u88>rek)|(?P<u89>reta)|(?P<u90>rock)|(?P<u93>shii)|(?P<u94>shiret)|(?P<u95>slei)|(?P<u96>slim)|(?P<u97>stai)|(?P<u98>sund)|(?P<u99>sunr)|(?P<u101>syle)|(?P<u102>tenc)|(?P<u103>tenf)|(?P<u104>thewo)|(?P<u105>uzb)|(?P<u106>vim)|(?P<u107>von)|(?P<u108>w3m)|(?P<u109>wel)|(?P<u110>worldw)|(?P<u111>wy)|(?P<u112>appen)|(?P<u113>bunj)|(?P<u114>playstation\s3)|(?P<u115>playstation\sp)|(?P<u116>libn)|(?P<u117>80l)|(?P<u118>aba)|(?P<u119>acc)|(?P<u120>adds)|(?P<u121>anya)|(?P<u122>b[^a-z]?l[^a-z]?i[^a-z]?t[^a-z]?z)|(?P<u123>bai)|(?P<u124>bec)|(?P<u125>bes)|(?P<u126>bill)|(?P<u127>bim)|(?P<u128>bingb)|(?P<u129>boitho)|(?P<u130>btb)|(?P<u131>catc)|(?P<u132>cer)|(?P<u133>charl)|(?P<u134>conv)|(?P<u135>cosm)|(?P<u136>cova)|(?P<u137>data)|(?P<u138>diam)|(?P<u139>discob)|(?P<u140>dotb)|(?P<u141>emer)|(?P<u142>espe)|(?P<u143>exab)|(?P<u144>fast\se)|(?P<u145>fast-)|(?P<u146>fds)|(?P<u147>findl)|(?P<u148>fur)|(?P<u149>fy)|(?P<u150>g2c)|(?P<u151>gais)|(?P<u152>galaxyb)|(?P<u153>genieb)|(?P<u154>giga)|(?P<u155>gir)|(?P<u157>googlebot-)|(?P<u158>guru)|(?P<u159>hap)|(?P<u160>hl_)|(?P<u161>hol)|(?P<u162>htd)|(?P<u163>ias)|(?P<u164>ia_)|(?P<u165>icc)|(?P<u166>ichi)|(?P<u167>igd)|(?P<u168>irl)|(?P<u169>iss)|(?P<u170>jax)|(?P<u171>jy)|(?P<u172>koe)|(?P<u173>webi)|(?P<u174>lap)|(?P<u175>larb)|(?P<u176>ldsp)|(?P<u177>lexx)|(?P<u178>lingu)|(?P<u179>linkw)|(?P<u180>lmsp)|(?P<u181>lwp)|(?P<u182>mab)|(?P<u183>magpie-)|(?P<u184>mediap)|(?P<u185>mj)|(?P<u186>mno)|(?P<u187>mog)|(?P<u188>moje)|(?P<u189>more)|(?P<u190>morn)|(?P<u191>msnb)|(?P<u192>msr)|(?P<u193>mva)|(?P<u194>mxb)|(?P<u195>netr)|(?P<u196>netse)|(?P<u197>newsg)|(?P<u198>ng-s)|(?P<u199>nice)|(?P<u200>nox)|(?P<u201>nuse)|(?P<u202>nutc)|(?P<u203>nym)|(?P<u204>\sob)|(?P<u205>oeg)|(?P<u206>omg)|(?P<u207>omnie)|(?P<u208>ooz)|(?P<u209>orb)|(?P<u210>pageb)|(?P<u211>peew)|(?P<u212>pol)|(?P<u213>pom)|(?P<u214>post)|(?P<u215>pyc)|(?P<u216>qs)|(?P<u217>radia)|(?P<u218>ramp)|(?P<u219>ruf)|(?P<u220>sandc)|(?P<u221>sbi)|(?P<u222>scou)|(?P<u223>scru)|(?P<u224>searchsi)|(?P<u225>seekb)|(?P<u226>sema)|(?P<u227>sensi)|(?P<u228>seo)|(?P<u229>sez)|(?P<u230>shim)|(?P<u231>shopw)|(?P<u232>shou)|(?P<u233>silk)|(?P<u234>sitebo)|(?P<u235>sna)|(?P<u236>sog)|(?P<u237>sos)|(?P<u238>spee)|(?P<u239>sqw)|(?P<u240>stac)|(?P<u241>sugg)|(?P<u242>surveyb)|(?P<u243>syno)|(?P<u244>teo)|(?P<u245>terr)|(?P<u246>thes)|(?P<u247>cz\s)|(?P<u248>tine)|(?P<u249>truw)|(?P<u250>turn)|(?P<u251>twee)|(?P<u252>twen)|(?P<u253>upd)|(?P<u254>urlf)|(?P<u255>vag)|(?P<u256>voi)|(?P<u257>vor)|(?P<u259>vy)|(?P<u260>webcol)|(?P<u261>websq)|(?P<u262>wf)|(?P<u263>wof)|(?P<u264>xal)|(?P<u265>yac)|(?P<u266>!\s)|(?P<u267>yahoos)|(?P<u268>yandexb)|(?P<u269>yandexi)|(?P<u270>yas)|(?P<u271>yet)|(?P<u272>yod)|(?P<u273>yoo)|(?P<u274>you)|(?P<u275>zao)|(?P<u276>zea)|(?P<u277>zs)|(?P<u278>zyb)|(?P<u279>thund)|(?P<u280>emai)|(?P<u281>blogl)|(?P<u282>ever)|(?P<u283>feedf)|(?P<u284>grea)|(?P<u285>greg)|(?P<u286>magpier)|(?P<u287>nfr)|(?P<u288>universalf)|(?P<u289>binge)|(?P<u293>url\sc)|(?P<u294>pea)|(?P<u296>pxy)|(?P<u297>pyt)|(?P<u298>abi)|(?P<u299>link\svale)|(?P<u300>link\svalidi)|(?P<u301>linke)|(?P<u302>linksm)|(?P<u303>mojo)|(?P<u304>notif)|(?P<u305>online\sl)|(?P<u306>ploe)|(?P<u307>reci)|(?P<u308>rel\s)|(?P<u309>siteba)|(?P<u310>w3c-)|(?P<u311>xenu\s)|(?P<u314>blaz)|(?P<u315>bol)|(?P<u316>series6)|(?P<u317>doris)|(?P<u318>doro)|(?P<u319>fen)|(?P<u320>gob)|(?P<u321>iem)|(?P<u322>iris)|(?P<u325>minim)|(?P<u326>netf)|(?P<u327>opera\smi)|(?P<u329>semc)|(?P<u330>sky)|(?P<u331>tea)|(?P<u332>tele)|(?P<u333>uza)|(?P<u334>offl)|(?P<u335>supe)|(?P<u336>web\sd)|(?P<u337>webcop)|(?P<u338>webz)|(?P<u339>wge)|(?P<u340>susi)|(?P<u341>amay)|(?P<u342>scif)|(?P<u343>domains)|(?P<u344>gsi)|(?P<u345>itu)|(?P<u346>lft)|(?P<u347>metau)|(?P<u348>nitr)|(?P<u349>sno)|(?P<u350>urd)|(?P<u351>webca)|(?P<u352>windows-)|(?P<u353>cse\s)|(?P<u354>cssc)|(?P<u355>cyn)|(?P<u356>p3p)|(?P<u357>htmlp)|(?P<u358>w3c_c)|(?P<u359>w3c_v)|(?P<u360>wd)|(?P<u361>masscan))|(?:(?P<u7>^(?!.*acoo).*Avant Browser(?!.*crazy))|(?P<u14>^(?!.*?(?:comodo_dragon|plus|flock|iron|rockmelt)).*?Chrome(?!.*?(?:avant|plus|edge|frame|iron)).*?$)|(?P<u25>Dooble(?!.*safari))|(?P<u31>Epiphany(?!.*bonecho))|(?P<u34>^(?!.*?(?:camino|epiphany|flock|icecat|iceweasel|galeon|lolifox|minefield|myibrow|namoroka|opera|seamonkey)).*?Firefox(?!.*?(?:classilla|comet|flock|iceweasel|kapiko|kazehakase|lunascape|madfox|midori|navigator|orca|palemoon|pogo|prism|tenfourfox|wyzo|fennec|maemo)).*?$)|(?P<u38>Galaxy(?!.*?(?:bot)).*?$)|(?P<u51>^(?!.*?(?:acoo|AOL|Deepnet|Nusearch|StackRambler|surf|opera|tencent)).*?(?:MSIE|AS;\srv)(?!.*?(?:America|Avant|Browzar|Crazy|Escape|GreenBrowser|iRider|KKman|Lobo|Lunascape|Maxthon|MyIE2|Sleipnir|SlimBrowser|TheWorld|AddSugar|Girafa|obot|SEOChat|Blazer|IEMobile|uZard|\.(?:com|edu))).*?$)|(?P<u59>^[^e]?links)|(?P<u66>^(?!.*?(?:acoo)).*?Maxthon)|(?P<u69>^(?!.*?(?:abrowse|beonex|bonecho|camino|chimera|conkeror|enigmafox|epiphany|firebird|firefox|fireweb|flock|galeon|granparadiso|ibrowse|icab|iceape|icecat|msie|as|k-meleon|k-ninja|kmlite|konqueror|lolifox|lorentz|midori|minefield|myibrow|namoroka|netscape|opera|palemoon|phoenix|prism|seamonkey|shiretoko|sundance|vonkeror|playstation|playstation|beslistbot|dotbot|koepabot|larbin|mj12bot|peew|vagabondo|fennec|minimo|opera|opera|teleca|Thunderbird|AppleWebKit|\.com|\.org|safari|browser)).*?Mozilla/5)|(?P<u71>^(?!.*?crazy).*?MyIE2)|(?P<u77>^(?!.*?(?:acoo|america|aol|avant|browzar|charon|chrome|crazy|deepnet|escape|firefox/[3-5]|fireweb|greenbrowser|navscape|netpositive|ibrowse|icab|msie|omniweb|opera|playstation|arachmo|b[^a-z]?l[^a-z]?i[^a-z]?t[^a-z]?z|Cerberian|bot|ask|crawl|capture|Kindle|rv:1\.(?:7\.13|8\.1\.15|8\.1\.3)|0\s;\sL)).*?(?:Netscape|Navigator|Mozilla/[2-4]\.[04-8]))|(?P<u91>^(?!.*?(?:arora|bonecho|camino|cheshire|chimera|comodo|deskbrowse|element|epiphany|firebird|flock|fluid|GranParadiso|hana|icab|msie|iron|LeechCraft|lunascape|Madfox|Maxthon|midori|Minefield|Namoroka|Navscape|NetNewsWire|Navigator|OmniWeb|Phoenix|Prism|QtWeb|Rekonq|RockMelt|firefox|chrome|netscape|opera|mozilla/3|SeaMonkey|Shiira|Stainless|Sunrise|Weltweitimnetz|yacy|Thunderbird|CLDC|Dorothy|Bolt|BlackBerry|Fennec|iris|Skyfire|teashark|iTunes|Android|Mach|20(?:02|04|07|0807|10))).*?(?:safari|(?:ppc|intel)\smac|AppleWebKit/5))|(?P<u92>^(?!.*?net).*?surf)|(?P<u100>(?<!net)surf)|(?P<u156>^(?!.*?image).*?googlebot)|(?P<u258>^voyager)|(?P<u290>^curl)|(?P<u291>^Java)|(?P<u292>^(?!.*?w3c).*?libwww-perl)|(?P<u295>^php)|(?P<u312>^(?!.*(?:fennec|opera)).*android(?!.*(?:opera|go|dorothy|3.5.8)))|(?P<u313>^(?!.*(?:opera)).*BlackBerry)|(?P<u323>Maemo(?!.*(?:fennec|opera)))|(?P<u324>MIB(?!.*seamonkey))|(?P<u328>(?!.*(?:midb)).*Opera mini))|(?P<u362>^(?!.*?(?:mobi|mini)).*?opera)#i'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">return </span><span class="syntaxkeyword">[</span><span class="syntaxstring">'inconnu'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'ABrowse'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Acoo Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'America Online Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'AmigaVoyager'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'AOL'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Arora'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Avant Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Beonex'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'BonEcho'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Camino'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Charon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Cheshire'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Chimera'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Chrome'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'ChromePlus'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Classilla'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'CometBird'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Comodo Dragon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Conkeror'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Crazy Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Cyberdog'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Deepnet Explorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'DeskBrowse'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Dillo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Dooble'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Edge'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Element Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Elinks'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Enigma Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'EnigmaFox'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Epiphany'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Escape'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Firebird'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Firefox'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Fireweb'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Flock'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Fluid'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Galaxy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Galeon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'GranParadiso'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'GreenBrowser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Hana'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'HotJava'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'IBM WebExplorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'IBrowse'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'iCab'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Iceape'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'IceCat'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Iceweasel'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'iNet Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Internet Explorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Iron'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'K-Meleon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'K-Ninja'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Kazehakase'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'KKman'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Konqueror'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'LeechCraft'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Links'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lobo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'lolifox'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lorentz'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lunascape'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lynx'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Madfox'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Maxthon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Midori'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Minefield'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mozilla'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'myibrow'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'MyIE2'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Namoroka'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Navscape'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'NCSA Mosaic'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'NetNewsWire'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'NetPositive'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Netscape'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'NetSurf'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'OmniWeb'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Orca'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Oregano'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Osb Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Palemoon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Phoenix'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Pogo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Prism'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'QtWeb Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Rekonq'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Retawq'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'RockMelt'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Safari'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SeaMonkey'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Shiira'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Shiretoko'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Sleipnir'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SlimBrowser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Stainless'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Sundance'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Sunrise'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Surf'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Sylera'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Tencent Traveler'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'TenFourFox'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'theWorld Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Uzbl'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Vimprobable'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Vonkeror'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'w3m'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Weltweitimnetz Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'WorldWideWeb'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Wyzo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Google App Engine'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bunjalloo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'PS3 Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'PSP Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Wii Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot 80legs'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot ABACHOBot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Accoona'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot AddSugarSpider'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot AnyApex'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Blitz'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Baidu'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Become'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Beslist'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot BillyBob'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Bim'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Bing'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Boitho'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot BT'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Catch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Cerberian'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Charlotte'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Convera'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Xyleme'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Covario'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot DataparkSearch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Diamond'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Discobot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Dotbot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot EmeraldShield'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Esperanza'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Exabot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot FAST Entreprise'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot FAST WebCrawler'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot FDSE'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot FindLinks'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Furl'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot FyberSpider'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot G2'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Gais'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Galaxy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Genie'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Giga'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Girafa'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Google'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Google Image'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Guruji'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot HappyFun'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot HL Ftien'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Holmes'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Htdig'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Iask'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot IA Archiver'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot ICcenter'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Ichiro'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Igde'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot IRL'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Issue'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Jaxified'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Jyxo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Koepa'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Lwebis'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Lapozz'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Larbin'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot LD'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Lexxe'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Linguee'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot LinkWalker'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot LM'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Lwp Trivial'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mabontland'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Magpie Crawl'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Google Mediapartners'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot MJ12bot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mnogosearch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mogimogi'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mojeek'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Moreover'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Morning Paper'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot MSN'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot MSRBot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot MVAClient'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mxbot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot NetResearchServer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot NetSeer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot NewsGator'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot NG Search'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Nice'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Noxtrum'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Nusearch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot NutchCVS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Nymesis'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Obot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Oegp'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Omgili'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot OmniExplorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot OOZ'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Orbiter'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot PageBites'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Peew'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Poly'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Pompos'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot PostPost'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Python cURL'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Qseero'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Radian6'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot RAMPy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Rufus'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Sand'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Sitesell'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot ScoutJet'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Scrubby'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot SearchSight'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Seekbot'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Semantic Discovery'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Sensis Web'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot SEOChat'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Seznam'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Shim'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot ShopWiki'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Shoula'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Silk'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Site'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Snappy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Sogou'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Soso'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Speedy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Sqworm'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot StackRambler'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Suggy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Survey'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Synoo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Teoma'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Terrawiz'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot TheSu'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Thumbnail CZ'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot TinEye'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot TruwoGPS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Turnitin'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot TweetedTimes'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Twenga'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Updated'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Urlfile'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Vagabondo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Voila'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Vortex'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Voyager'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot VYU2'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Webcollage'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Websquash'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot WF84'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot WoFindeIch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Xaldon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yacy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yahoo Slurp'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yahoo Seeker'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yandex'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yandex Images'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yasakli'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yeti'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Yodao'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot YoogliFetch'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Youdao'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Zao'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Zeal'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Redkolibri'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot ZyBorg'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mailer Thunderbird'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot EmailSiphon'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher Bloglines'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher Everyfeed'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher Google'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher GreatNews'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher Gregarius'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher MagpieRSS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher NFReader'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Feed Fetcher Universal'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Php BinGet'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Curl'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Java'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Perl Libwww'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Microsoft URL Control'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Peach'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'PHP'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Pxyscand Proxy Scanner'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Python Urllib'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker AbiLogic'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Valet'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Validity'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Examiner'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Manager'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Mojoo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Notifixious'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Online Validator'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Ploetz Zeller'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker InfoWizards PRO'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker REL Lite'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SiteBar Bookmark Manager'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker W3C'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Xenu Sleuth'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Android Webkit'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile BlackBerry'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Palm Blazer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Bolt'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Series60'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Doris'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Dorothy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Fennec'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile GoBrowser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Internet Explorer'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Iris'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Maemo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile MIB'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Minimo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile NetFront'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Opera Mini'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Opera'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile SEMC'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Skyfire'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'TeaShark'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Mobile Teleca Obigo'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'uZard Web'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Offline Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Super'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Offline Browser Web Downloader'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Offline Browser WebCopier'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Offline Browser WebZIP'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Wget'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bookmark Collector Susie'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib W3C Amaya'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Del.icio.us Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot Domainsdb'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot GSite'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'iTunes Browser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'LFTP Client'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Bot MetaURI'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Nitro PDF'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Snoopy'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Usenet Resource Downloader'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Adobe WebCapture'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows Media Player'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker CSE HTML'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker CSSCheck'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker Cynthia'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Link Checker P3P'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Lib Java HTMLParser'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'W3C CSS Validator'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'W3C Validator'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'WDG Validator'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Port Scanner Masscan'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Opera'</span><span class="syntaxkeyword">][(int)@</span><span class="syntaxdefault">substr</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">array_filter</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">array_slice</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">))),</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">)];<br />}<br /></span><span class="syntaxdefault"></span>

    Elle est censée détecter un très grand nombre de navigateurs car elle a été fondée sur plus de 65 millions de chaines HTTP_USER_AGENT fournies, si vous en connaissez qui ne sont pas dans la liste, faites-le moi savoir :)

    pour la tester on peut faire

    PHP:
    <span class="syntaxdefault"><br /></span><span class="syntaxkeyword"><?</span><span class="syntaxdefault">php<br />echo </span><span class="syntaxstring">'Mon navigateur est '</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">detect_browser</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault"></span>
     
  2. spout
    spout WRInaute accro
    Inscrit:
    14 Mai 2003
    Messages:
    8 811
    J'aime reçus:
    242
  3. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    Merci, mais cette fonction ne détecte pas autant de navigateurs que celle proposée dans ce sujet..
    La fonction proposée dans ce sujet est normalement censée tous les détecter, y compris les bots etc
     
  4. niap
    niap WRInaute discret
    Inscrit:
    17 Octobre 2009
    Messages:
    139
    J'aime reçus:
    0
    Merci pour le partage :)
     
  5. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    Bonjour :)

    pour compléter ce sujet je rajoute une fonction sur la même base qui permet de détecter l'architecture utilisée par le client (64 bits ou non), cette fonction retourne 32 bits quand elle ne peut pas détecter 64 bits, elle ne retourne jamais "inconnu"..

    PHP:
    <span class="syntaxdefault"><br /></span><span class="syntaxkeyword">function&nbsp;</span><span class="syntaxdefault">detect_architecture</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">null</span><span class="syntaxkeyword">){<br />if(!</span><span class="syntaxdefault">is_string</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">))</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">$_SERVER</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'HTTP_USER_AGENT'</span><span class="syntaxkeyword">];<br />return&nbsp;</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'#(?:(?:wow|x86[-_]|ia|amd|win|sparc|(?:(?:[\s;]|236|197)x))64)|(?:os[^a-z]?x[^a-z](?:10[^a-z]?(?:[8-9]|[1-9][0-9])|[2-9]))#i'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">)?</span><span class="syntaxstring">'64'</span><span class="syntaxkeyword">:</span><span class="syntaxstring">'32'</span><span class="syntaxkeyword">;<br />}<br /><br /></span><span class="syntaxcomment">/* Exemple d'utilisation */<br /><br /></span><span class="syntaxdefault">echo </span><span class="syntaxstring">'<pre>'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">echo </span><span class="syntaxstring">'J\'utilise une architecture '</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">detect_architecture</span><span class="syntaxkeyword">().</span><span class="syntaxstring">' bits'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault"></span>

    Si par hasard vous utilisez une architecture 64 bits qui ne serait pas détectée faites-moi le savoir :)
     
  6. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    Dans la lignée des deux fonctions précédentes, en voilà une dernière qui détecte de nombreux systèmes d'exploitation..

    PHP:
    <span class="syntaxdefault"><br /></span><span class="syntaxkeyword"><?</span><span class="syntaxdefault">php<br />function detect_os</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">null</span><span class="syntaxkeyword">){<br />if(!</span><span class="syntaxdefault">is_string</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">))</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">=</span><span class="syntaxdefault">$_SERVER</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'HTTP_USER_AGENT'</span><span class="syntaxkeyword">];</span><span class="syntaxdefault">preg_match</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'#(?P<u1>aix)|(?P<u2>amig)|(?P<u3>android)|(?P<u4>beos|netpositive)|(?P<u5>BlackBerry)|(?P<u6>cros\si)|(?P<u7>cp/m)|(?P<u8>darw)|(?P<u9>dragonf)|(?P<u10>freebsd)|(?P<u11>hp-u)|(?P<u12>irix)|(?P<u13>infe)|(?P<u15>netbs)|(?P<u18>openb)|(?P<u19>openso)|(?P<u20>qnx)|(?P<u21>risc)|(?P<u22>r-bl)|(?P<u24>syll)|(?P<u25>symbo)|(?P<u26>symbi)|(?P<u27>osf1)|(?P<u28>unix)|(?P<u29>webt)|(?P<u30>nt\s10)|(?P<u31>nt\s5\.0)|(?P<u32>ws\s3)|(?P<u35>win(?:dows\s?)?95)|(?P<u36>win(?:dows\s?)?98)|(?P<u39>ws\smo)|(?P<u40>ws\sph)|(?P<u41>ws\snt\s5\.2;)|(?P<u42>ws\snt\s6\.0)|(?P<u44>iPhone\sos|iP[ap]d)|(?:(?P<u14>^(?!.*(?:wind|andro)).*linux)|(?P<u16>^(?!.*(?:ip[ah]|wind)).*os[^a-z]?x)|(?P<u17>^(?!.*sym).*os/2)|(?P<u23>^(?!.*win).*suno)|(?P<u33>^(?!.*andr).*nt\s6\.1)|(?P<u34>^(?!.*andr).*nt\s6\.2)|(?P<u37>^(?!.*%\snt).*ws\sce)|(?P<u38>(?:ws\sme)|(?:9x\s4\.90))|(?P<u43>^(?!.*(?:linux|os[^a-z]?x|nt\s(?:5\.0|6\.[01]))).*nt\s5\.1;))#i'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">return </span><span class="syntaxkeyword">[</span><span class="syntaxstring">'inconnu'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Advanced Interactive eXecutive'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'AmigaOS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Android'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'BeOS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'BlackBerry OS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Chrome OS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Control Program/Monitor'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Darwin OS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'DragonFly BSD'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'FreeBSD'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Hewlett Packard UniX'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'IRIX'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Inferno'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Linux'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'NetBSD'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'OS X'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'OS/2'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'OpenBSD'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'OpenSolaris'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'QNX'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'RISC OS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Star-Blade'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SunOS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Syllable'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SymbOS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'SymbianOS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Tru64 UNIX'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Unix'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'WebTV'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 10'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 2000'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 3.1'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 7'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 8'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 95'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows 98'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows CE'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows ME'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows Mobile'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows Phone OS'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows Server 2003'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows Vista'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'Windows XP'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'iPhone OS'</span><span class="syntaxkeyword">][(int)@</span><span class="syntaxdefault">substr</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">key</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">array_filter</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">array_slice</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$a</span><span class="syntaxkeyword">,</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">))),</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">)];<br />}<br /></span><span class="syntaxcomment">/* Exemple d'utilisation */<br /><br /></span><span class="syntaxdefault">echo </span><span class="syntaxstring">'<pre>'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">echo </span><span class="syntaxstring">'Mon système d\'exploitation est&nbsp;'</span><span class="syntaxkeyword">.</span><span class="syntaxdefault">detect_os</span><span class="syntaxkeyword">();<br />&nbsp;</span><span class="syntaxdefault"></span>
    N'hésitez pas à me dire si vous trouvez un bug ou un OS non détecté ;)
     
  7. ortolojf
    ortolojf WRInaute accro
    Inscrit:
    14 Août 2002
    Messages:
    2 846
    J'aime reçus:
    8
    Bonjour Monsieur

    Moi, pour détecter les robots, j'utlise le reverse de l'ip.

    Avec la fonction suivante :

    Code:
    
    $tmp  = shell_exec('host -W 2 ' . $remote_addr);
    
    
    Pour IPV4.

    C'est rapide et efficace.

    Pour l'IPV6, je sais pas.

    Respectueusement.
     
  8. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    Bonjour, merci pour l'astuce d'ouvrir un shell_exec, l'idée de ces 3 petites fonctions est de faire des détections en un temps très court, faire un reverse IP peut prendre plusieurs secondes.. Donc le stocker en session pourquoi pas, mais sur le coup pour un chargement rapide je n'ai rien trouvé d'autre..

    La fonction get_browser de php prend presque 1 seconde avec le fichier ini en mode "full" et une vingtaine de ms en mode "lite" mais elle consomme beaucoup trop de mémoire et ne détecte pas autant de navigateurs que celle proposée, cependant elle est tenue à jour, contrairement a ces 3 fonctions...

    Cordialement
     
  9. niap
    niap WRInaute discret
    Inscrit:
    17 Octobre 2009
    Messages:
    139
    J'aime reçus:
    0
    Petite question, pour ma curiosité personnelle.
    Autant je peux comprendre l'utilité de détecter le navigateur / OS, mais dans quel cas vous avez besoin de savoir si la machine client est en 32 ou 64 bits ?
     
  10. mike.php
    mike.php Nouveau WRInaute
    Inscrit:
    25 Décembre 2016
    Messages:
    13
    J'aime reçus:
    0
    C'est toujours un petit plus, si l'on doit proposer un pilote ou un logiciel au client et que celui-ci existe en version 64 bits, autant lui proposer une version compatible/optimisée pour sa machine :)
     
  11. magvore
    magvore Nouveau WRInaute
    Inscrit:
    31 Juillet 2018
    Messages:
    1
    J'aime reçus:
    0
    Bonjour,

    J'ai testé votre fonction PHP pour détecter le navigateur utilisé par un client en fonction de son
    HTTP_USER_AGENT.

    Mais cela me donne : Mon navigateur est Dooble à la place de Chrome.

    Une idée de l'erreur ?
    Cordialement
     
  12. Drew
    Drew WRInaute discret
    Inscrit:
    2 Juillet 2015
    Messages:
    200
    J'aime reçus:
    17
    PHP:
    <?php
    function get_browser_name($user_agent)
    {
    if(
    strpos($user_agent,'Opera') || strpos($user_agent,'OPR/')) return 'Opera';
    elseif(
    strpos($user_agent,'Edge')) return 'Edge';
    elseif(
    strpos($user_agent,'Chrome')) return 'Chrome';
    elseif(
    strpos($user_agent,'Safari')) return 'Safari';
    elseif(
    strpos($user_agent,'Firefox')) return 'Firefox';
    elseif(
    strpos($user_agent,'MSIE') || strpos($user_agent,'Trident/7')) return 'Internet Explorer';
    return 
    'Other';
    }
    ?>
    J'utilise ça et ça suffit largement.
     
  13. spout
    spout WRInaute accro
    Inscrit:
    14 Mai 2003
    Messages:
    8 811
    J'aime reçus:
    242
Chargement...
Similar Threads - [PHP] Détecter navigateur Forum Date
[PHP] Détecter le navigateur / bot en fonction du HTTP_USER_AGENT Développement d'un site Web ou d'une appli mobile 14 Septembre 2019
[PHP] Détecter l'OS, le navigateur et la langue [Résolu] Développement d'un site Web ou d'une appli mobile 4 Mars 2012
[PHP] Cookie vide dans une fonction, complet juste avant ou après Développement d'un site Web ou d'une appli mobile 25 Novembre 2014
[php] Cookie d'un domaine vers un sous-domaine Développement d'un site Web ou d'une appli mobile 29 Août 2014
[PHP]Cci mails Développement d'un site Web ou d'une appli mobile 18 Août 2014
[PHP] gethostbyname Développement d'un site Web ou d'une appli mobile 15 Février 2014
[PHP] file_get_contents retourne un "Connection timed out" Développement d'un site Web ou d'une appli mobile 14 Février 2014
[PHP] Regex Complexe Développement d'un site Web ou d'une appli mobile 29 Octobre 2013
[PHP] Formulaire dynamique Développement d'un site Web ou d'une appli mobile 2 Mai 2013
[php] error suite à code antiduplication Développement d'un site Web ou d'une appli mobile 5 Février 2013
  1. Ce site utilise des cookies. En continuant à utiliser ce site, vous acceptez l'utilisation des cookies.
    Rejeter la notice