Jump to content

wats this code doing?


Monkuar

Recommended Posts

 list( $this->member['AVATAR_WIDTH'] , $this->member['AVATAR_HEIGHT']  ) = explode ("x", $this->member['avatar_size']);

 

I get

 

Notice: Undefined offset: 1

 

any idea?

 

Is is the avatar_width or avatar_height?

 

I also tried

 

 $this->member['AVATAR_HEIGHT'] = (empty($this->member['AVATAR_HEIGHT'])) ? '' : $this->member['AVATAR_HEIGHT'];
         $this->member['AVATAR_WIDTH'] = (empty($this->member['AVATAR_WIDTH'])) ? '' : $this->member['AVATAR_WIDTH'];
	 $this->member['avatar_size'] = (empty($this->member['avatar_size'])) ? '' : $this->member['avatar_size'];

 

still doesn't work or get rid of the error

Link to comment
https://forums.phpfreaks.com/topic/256697-wats-this-code-doing/
Share on other sites

The error comes from the fact that $this->member['avatar_size'] does not contain a lowercase 'x'.  That line you posted simply takes $this->member['avatar_size'], and says "the item before the x is the width, and the item after the x is the height."  It assumes an x will be there, producing two items.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.