Jump to content
Sign in to follow this  

get_browser error warning for some offsets but not all

Recommended Posts

I have browscap installed this way: 


If I use the following code: 

    $browser = get_browser(null, true);
	$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:


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



what causes the Illegal String Offset warning error message?

Edited by BrainPill

Share this post

Link to post
Share on other sites

It's not a reserved variable, you overwrote it:

$browser = $browser['browser'];

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...