/    Sign up×
Community /Pin to ProfileBookmark

How do I Detect for Mobile Browser

I downloaded the source code on how to detect mobile browser for detectmobilebrowser.com but they do not have any documentation and code is very cryptic.

I just want it to do this.

If it is a mobile browser then take the user to this site: [url]http://fmdentalcentre.com/mobile[/url]
I tried modifying the source code but it does not work.

[CODE]<?php
$useragent=$_SERVER[‘HTTP_USER_AGENT’];
if(preg_match(‘/(android|bbd+|meego)
…some code…
header(‘Location: http://www.fmdentalcentre.com/mobile’);
?>[/CODE]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ptotaramApr 16.2013 — What framework/environment are you using, many times your framework has a built-in method in doing this.
×

Success!

Help @locbtran spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...