Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php get browser

<?php
  echo $_SERVER['HTTP_USER_AGENT'];
  $browser = get_browser();
  print_r($browser);
?>
Comment

php get browser

function get_browser_name($user_agent){
    $t = strtolower($user_agent);
    $t = " " . $t;
    if     (strpos($t, 'opera'     ) || strpos($t, 'opr/')     ) return 'Opera'            ;   
    elseif (strpos($t, 'edge'      )                           ) return 'Edge'             ;   
    elseif (strpos($t, 'chrome'    )                           ) return 'Chrome'           ;   
    elseif (strpos($t, 'safari'    )                           ) return 'Safari'           ;   
    elseif (strpos($t, 'firefox'   )                           ) return 'Firefox'          ;   
    elseif (strpos($t, 'msie'      ) || strpos($t, 'trident/7')) return 'Internet Explorer';
    return 'Unkown';
}
echo get_browser_name($_SERVER['HTTP_USER_AGENT']);//Chrome
Comment

php in browser

echo Hallo
Comment

PREVIOUS NEXT
Code Example
Php :: collection laravel filter 
Php :: get site url with protocol in php 
Php :: php array has value 
Php :: laravel session forget 
Php :: php move file 
Php :: unique validation on update laravel 
Php :: alert in php 
Php :: regex for email php 
Php :: eloquent using last() 
Php :: docx file validation laravel 8 
Php :: wordpress echo the page title 
Php :: php check if string email 
Php :: js check if div is empty 
Php :: include php 
Php :: laravel php short if 
Php :: Invalid route action: [AdminAppHttpControllersAdminOrdersController]. 
Php :: check if value exists in object php 
Php :: the requested url was not found on this server. laravel 
Php :: wordpress if is in categroy 
Php :: laravel pagination publish command 
Php :: check if value is not null in db laravel 
Php :: how to remove jstream package 
Php :: db connection postgres laravel 
Php :: docker invalid port 80 
Php :: get http host laravel 
Php :: loop through values of hash php 
Php :: display summernonte data with string limit laravel 
Php :: how to forget session in laravel 
Php :: /laravel-2020-07-27.log" could not be opened 
Php :: get image name and extension laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =