Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php detect mobile

function isMobileDevice() {
    return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo
|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up.browser|up.link|webos|wos)/i"
, $_SERVER["HTTP_USER_AGENT"]);
}
Comment

Mobile detector in PHP

<?php
function isMobileDevice() {
    return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo
|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up.browser|up.link|webos|wos)/i"
, $_SERVER["HTTP_USER_AGENT"]);
}
if(isMobileDevice()){
    echo "Mobile Browser Detected";
}
else {
    echo "Mobile Browser Not Detected";
}
?>
Comment

Detect Mobile Platform On Php

<?php


function detect_platform() {
	if (preg_match('/iphone|ipad|ipod/i', $_SERVER['HTTP_USER_AGENT'])) {
		if (!preg_match('/safari/[0-9]+/i', $_SERVER['HTTP_USER_AGENT'])) {
			return 'ios-share';
		} else {
			return 'ios';
		}
	} else if (stripos($_SERVER['HTTP_USER_AGENT'], 'android')!==false) {
		return 'android';
	} else {
		return 'default';
	}
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel go back to previous page blade 
Php :: php validate name 
Php :: mask card php 
Php :: php fwrite new line 
Php :: docker invalid port 80 
Php :: customer io send_at api 
Php :: PHP dynamic property name 
Php :: php iterate array 
Php :: Command "make:controller" is not defined. 
Php :: how to delete image from floder in laravel 
Php :: laravel install production 
Php :: laravel modules slowdown 
Php :: iterator impliment php 
Php :: php import function from another file 
Php :: set null on foreign key deletion in laravel 
Php :: Detecting russian characters on a form in PHP 
Php :: migration bool type eloquent orm 
Php :: object to array php 
Php :: get php to send email from form 
Php :: laravel descending order paginate eloquent 
Php :: symfony convert entity to array 
Php :: codeigniter where_not_in 
Php :: copy php array to javascript 
Php :: errno: 150 foreign key constraint is incorrectly formed laravel 8 
Php :: php create from format 
Php :: how to take input in php 
Php :: how to remove public from url in laravel 8 
Php :: laravel collection remove duplicates 
Php :: update json file php 
Php :: add column migration laravel 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =