Jump to content

get_browser error warning for some offsets but not all


BrainPill
 Share

Recommended Posts

I have browscap installed this way: 

X:/wamp64/browscap/lite_php_browscap.ini

If I use the following code: 

    <?php 
    $browser = get_browser(null, true);
	var_dump($browser);
	 
	$brows_par = $browser['parent'];
	$browser = $browser['browser'];
		 
	$version = $browser['version'];
	 
 	$platform = $browser['platform'];
	$dev_type = $browser['device_type'];
	$mobile = $browser['ismobiledevice'];
	$tablet = $browser['istablet'];

	?>

 

Then I get error messages for the last 5 variable settings

error output:

Quote

Warning: Illegal string offset 'version'

and for the other offsets same error message except the first 2.

 

see the image for the var_dump value of $browser

Cut-var-dump-browscap.png

 

what causes the Illegal String Offset warning error message?

Edited by BrainPill
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...