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

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 :: Export Database Records to CSV 
Php :: laravel where json array column 
Php :: get image field in custom post type category taxonomy 
Php :: auth user with relation laravel 
Php :: jquery get data from php 
Php :: yajra datatables html column bulder example 
Php :: create laravel migration 
Php :: php superglobal - $globals 
Php :: laravel eloquent with 
Php :: define function in php 
Php :: substr_count excact match php 
Php :: if else in one line php 
Php :: how to append an array into associative array 
Php :: API call in PHP using cURL 
Php :: show widget using the shortcode from php 
Php :: logout all users laravel 8 
Php :: array to string conversion in laravel controller 
Php :: mailjet 
Php :: oop in php 
Php :: php loop object keys 
Php :: how to execute php in linux 
Php :: laravel 8 cron job 
Php :: phpspreadsheet 
Php :: optional route parameter in laravel 
Php :: pegar porcentagem de um valor php 
Php :: laravel collection zip 
Php :: php ::class 
Php :: breaks the collection into multiple smaller collections Laravel 
Php :: how to get session variables from cookie string 
Php :: php preg_match html cross origin 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =