There are so many mobile browsers available today that it would be difficult to specify each one. Unfortunately, if you wanted to detect the user browser through javascript you would have to explicitly specify each browser/mobile device and which action to perform if that mobile device is detected. Fortunately enough this can be significantly simplified using some simple PHP code as shown below:

$container = $_SERVER['HTTP_USER_AGENT'];
	$mobile = false;
	$useragents = array (
		'opera mini',
	foreach ( $useragents as $useragent ) {
		if(stripos($container, $useragent)) {
			$mobile = true;

	} else {

Using the code above you can simply echo out specific HTML or javascript code based on what type of device a user is on.


or Sign Up

Sign Up

or Login
Cheers Friend!

I'm Tony, the creator of this site. I'm trying to increase my twitter following. Want to follow me?

Follow @tnylea If not, no worries :)