code: public function userAgent( $user_agent )
  	{
  		if ( strpos( $user_agent, "Firefox/" ) !== false ) {
  			$browser = "Firefox";
  		} elseif ( strpos( $user_agent, "Opera/" ) !== false || strpos( $user_agent, 'OPR/' ) !== false ) {
  			$browser = "Opera";
  		} elseif ( strpos( $user_agent, "YaBrowser/" ) !== false ) {
  			$browser = "Yandex";
  		} elseif ( strpos( $user_agent, "Chrome/" ) !== false ) {
  			$browser = "Chrome";
  		} elseif ( strpos( $user_agent, "MSIE/" ) !== false || strpos( $user_agent, 'Trident/' ) !== false ) {
  			$browser = "Internet Explorer";
  		} elseif ( strpos( $user_agent, "Safari/" ) !== false ) {
  			$browser = "Safari";
  		} else {
  			$browser = "Undefined";
  		}
  
  		return $browser;
  	}
docs: @param $user_agent
  
  @return string